Part Number Hot Search : 
32000 PIC12C5 CHB50 1N5360B MAX705 SD1060YS MBZ5230 619333E3
Product Description
Full Text Search
 

To Download ADE7878 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  polyphase multifunction energy metering ic with per phase active and reactive powers ADE7878 rev. 0 information furnished by analog devices is believed to be accurate and reliable. however, no responsibility is assumed by analog devices for its use, nor for any infringements of patents or other rights of third parties that may result from its use. specifications subject to change without notice. no license is granted by implication or otherwise under any patent or patent rights of analog devices. trademarks and registered trademarks are the property of their respective owners. one technology way, p.o. box 9106, norwood, ma 02062-9106, u.s.a. tel: 781.329.4700 www.analog.com fax: 781.461.3113 ?2010 analog devices, inc. all rights reserved. features highly accurate; supports en 50470-1, en 50470-3, iec 62053-21, iec 62053-22, and iec 62053-23 standards compatible with 3-phase, 3- or 4-wire (delta or wye), and other 3-phase services supplies total (fundamental and harmonic) active/reactive/ apparent energy and fundamental active/reactive energy on each phase and on the overall system less than 0.1% error in active and reactive energy over a dynamic range of 1000 to 1 at t a = 25c less than 0.2% error in active and reactive energy over a dynamic range of 3000 to 1 at t a = 25c supports current transformer and di/dt current sensors dedicated adc channel for neutral current input less than 0.1% error in voltage and current rms over a dynamic range of 1000 to 1 at t a = 25c supplies sampled waveform data on all three phases and on neutral current selectable no load threshold levels for total and fundamental active and reactive powers, as well as for apparent powers low power battery mode monitors phase currents for antitampering detection battery supply input for missing neutral operation phase angle measurements in both current and voltage channels with a typical 0.3 error wide-supply voltage operation: 2.4 v to 3.7 v reference: 1.2 v (drift 10 ppm/c typical) with external overdrive capability single 3.3 v supply 40-lead lead frame chip scale package (lfcsp), pb-free operating temperature: ?40 to +85c flexible i 2 c, spi, and hsdc serial interfaces applications energy metering systems general description the ADE7878 1 is a high accuracy, 3-phase electrical energy measurement ic with serial interfaces and three flexible pulse outputs. the ADE7878 incorporates second-order sigma-delta (-) analog-to-digital converters (adcs), a digital integrator, reference circuitry, and all the signal processing required to perform total (fundamental and harmonic) active, reactive, and apparent energy measurement and rms calculations, as well as fundamental only active and reactive energy measurement and rms calculations. a fixed function digital signal processor (dsp) executes this signal processing. the dsp program is stored into internal rom memory. the ADE7878 is suitable for measuring active, reactive, and apparent energy in various 3-phase configurations, such as wye or delta services, with both three and four wires. the ADE7878 provides system calibration features for each phase, that is, rms offset correction, phase calibration, and gain calibration. the cf1, cf2, and cf3 logic outputs provide a wide choice of power information: total active, reactive, and apparent powers, or the sum of the current rms values, and fundamental active and reactive powers. the ADE7878 contains waveform sample registers that allow access to all adc outputs. the device also incorporates power quality measurements, such as short duration low or high voltage detections, short duration high current variations, line voltage period measurement, and angles between phase voltages and currents. two serial interfaces, spi and i 2 c, can be used to communicate with the ADE7878. a dedicated high speed interface, the high speed data capture (hsdc) port, can be used in conjunction with i 2 c to provide access to the adc outputs and real-time power information. the ADE7878 also has two interrupt request pins, irq0 and irq1 , to indicate that an enabled interrupt event has occurred. for the ADE7878, three specially designed low power modes ensure the continuity of energy accumulation when the ADE7878 is in a tampering situation. the ADE7878 is available in a 40-lead lfcsp, pb-free package. 1 u.s. patents pending.
ADE7878 rev. 0 | page 2 of 92 table of contents features .............................................................................................. 1 ? applications ....................................................................................... 1 ? general description ......................................................................... 1 ? revision history ............................................................................... 3 ? functional block diagram .............................................................. 4 ? specifications ..................................................................................... 5 ? timing characteristics ................................................................ 8 ? absolute maximum ratings .......................................................... 11 ? thermal resistance .................................................................... 11 ? esd caution ................................................................................ 11 ? pin configuration and function descriptions ........................... 12 ? typical performance characteristics ........................................... 14 ? test circuit ...................................................................................... 17 ? terminology .................................................................................... 18 ? power management ........................................................................ 19 ? psm0normal power mode ................................................... 19 ? psm1reduced power mode.................................................. 19 ? psm2low power mode ......................................................... 19 ? psm3sleep mode .................................................................... 20 ? power-up procedure .................................................................. 20 ? hardware reset ........................................................................... 21 ? software reset functionality .................................................... 21 ? theory of operation ...................................................................... 24 ? analog inputs .............................................................................. 24 ? analog-to-digital conversion .................................................. 24 ? antialiasing filter ................................................................... 25 ? adc transfer function ......................................................... 25 ? current channel adc ............................................................... 25 ? current waveform gain registers ....................................... 26 ? current channel hpf ........................................................... 26 ? current channel sampling ................................................... 27 ? di/dt curent sensor and digital integrator ............................. 27 ? voltage channel adc ................................................................ 28 ? voltage waveform gain registers ........................................ 28 ? voltage channel hpf ............................................................ 28 ? voltage channel sampling .................................................... 28 ? changing phase voltage datapath ........................................... 29 ? power quality measurements ................................................... 29 ? zero crossing detection ....................................................... 29 ? zero-crossing timeout ......................................................... 30 ? phase sequence detection .................................................... 30 ? time interval between phases ............................................. 31 ? period measurement .............................................................. 32 ? phase voltage sag detection ................................................. 32 ? peak detection ........................................................................ 33 ? overvoltage and overcurrent detection ............................ 34 ? neutral current mismatch ................................................... 35 ? phase compensation ................................................................. 35 ? reference circuit ........................................................................ 37 ? digital signal processor ............................................................. 37 ? root mean square measurement ............................................. 37 ? current rms calculation ..................................................... 38 ? current mean absolute value calculation ......................... 39 ? voltage channel rms calculation ...................................... 40 ? voltage rms offset compensation ..................................... 41 ? active power calculation .......................................................... 41 ? total active power calculation ............................................ 41 ? fundamental active power calculation .............................. 43 ? active power gain calibration ............................................. 43 ? active power offset calibration .......................................... 43 ? sign of active power calculation ......................................... 43 ? active energy calculation .................................................... 44 ? integration time under steady load .................................. 45 ? energy accumulation modes ............................................... 46 ? line cycle active energy accumulation mode ................. 46 ? reactive power calculation ...................................................... 47 ? reactive power gain calibration ......................................... 48 ? reactive power offset calibration ....................................... 48 ? sign of reactive power calculation ..................................... 48 ? reactive energy calculation ................................................. 49 ? integration time under a steady load .............................. 51 ? energy accumulation modes ............................................... 51 ? line cycle reactive energy accumulation mode ............. 51 ? apparent power calculation ..................................................... 52 ? apparent power gain calibration ....................................... 53 ? apparent power offset calibration ..................................... 53 ?
ADE7878 rev. 0 | page 3 of 92 apparent power calculation using vnom ........................ 53 ? apparent energy calculation ................................................ 53 ? integration time under steady load ................................... 54 ? energy accumulation mode .................................................. 54 ? line cycle apparent energy accumulation mode ............. 54 ? waveform sampling mode ........................................................ 55 ? energy-to-frequency conversion ............................................ 55 ? synchronizing energy registers with cfx outputs ........... 57 ? cf outputs for various accumulation modes ................... 57 ? sign of sum-of-phase powers in the cfx datapath ........... 59 ? no load condition ..................................................................... 59 ? no load detection based on total active, reactive powers ................................................................................................... 59 ? no load detection based on fundamental active and reactive powers ....................................................................... 60 ? no load detection based on apparent power ................... 60 ? checksum register ..................................................................... 60 ? interrupts ..................................................................................... 62 ? using the interrupts with an mcu ...................................... 62 ? serial interfaces ........................................................................... 63 ? serial interface choice ........................................................... 63 ? i 2 c-compatible interface ....................................................... 63 ? spi-compatible interface ...................................................... 65 ? hsdc interface ....................................................................... 65 ? ADE7878 evaluation board ...................................................... 69 ? die version .................................................................................. 69 ? registers list .................................................................................... 70 ? outline dimensions ........................................................................ 90 ? ordering guide ........................................................................... 90 ? revision history 2 /10revision 0: initial version
ADE7878 rev. 0 | page 4 of 92 functional block diagram pga1 pga1 pga1 pga3 pga3 pga3 1.2v ref active/reactive/ apparent/total/fundamental energies and voltage/current rms calculation for phase b (see phase a for detailed data path) active/reactive/ apparent/total/fundamental energies and voltage/current rms calculation for phase c (see phase a for detailed data path) digital signal processor computational block for total reactive power avgain aphcal hpfdis [23:0] hpf nigain hpfdis [23:0] hpf aigain hpfdis [23:0] digital integrator hpf digital integrator por ldo ldo x 2 airms lpf airmsos x 2 x 2 avrms lpf lpf avrmsos avagain lpf computational block for fundamental active and reactive power awgain nirms nirmsos awattos avargain avaros afwgain afwattos afvargain afvaros phase a, b and c data dfc cf1den : dfc cf2den : dfc cf3den : 5 24 26 25 17 4 7 8 9 22 12 13 14 19 18 39 37 38 36 32 29 35 34 33 3 2 27 28 23 6 spi/i 2 c i 2 c reset ref in/out vdd agnd avdd dvdd dgnd clkin clkout iap ian vap ibp ibn vbp icp icn vcp vn pm0 pm1 cf1 cf2 cf3/hsclk irq0 irq1 sclk/scl mosi/sda miso/hsd ss/hsa hsdc ADE7878 adc adc adc adc adc adc pga2 15 16 inp inn adc 08510-201 figure 1.
ADE7878 rev. 0 | page 5 of 92 specifications vdd = 3.3 v 10%, agnd = dgnd = 0 v, on-chip reference, clkin = 16.384 mhz, t min to t max = ?40c to +85c. table 1. parameter 1 , 2 min typ max unit test conditions/comments accuracy active energy measurement active energy measurement error (per phase) total active power 0.1 % over a dynamic range of 1000 to 1, pga = 1, 2, 4; integrator off 0.2 % over a dynamic range of 3000 to 1, pga = 1, 2, 4; integrator off 0.1 % over a dynamic range of 500 to 1, pga = 8, 16; integrator on fundamental active power 0.1 % over a dynamic range of 1000 to 1, pga = 1, 2, 4; integrator off 0.2 % over a dynamic range of 3000 to 1, pga = 1, 2, 4; integrator off 0.1 % over a dynamic range of 500 to 1, pga = 8, 16; integrator on phase error between channels line frequency = 45 hz to 65 hz, hpf on pf = 0.8 capacitive 0.05 degrees phase lead 37 pf = 0.5 inductive 0.05 degrees phase lag 60 ac power supply rejection vdd = 3.3 v + 120 mv rms/120 hz, ipx = vpx = 100 mv rms output frequency variation 0.01 % dc power supply rejection vdd = 3.3 v 330 mv dc output frequency variation 0.01 % total active energy measurement bandwidth 2 khz reactive energy measurement reactive energy measurement error (per phase) total active power 0.1 % over a dynamic range of 1000 to 1, pga = 1, 2, 4; integrator off 0.2 % over a dynamic range of 3000 to 1, pga = 1, 2, 4; integrator off 0.1 % over a dynamic range of 500 to 1, pga = 8, 16; integrator on fundamental active power 0.1 % over a dynamic range of 1000 to 1, pga = 1, 2, 4; integrator off 0.2 % over a dynamic range of 3000 to 1, pga = 1, 2, 4; integrator off 0.1 % over a dynamic range of 500 to 1, pga = 8, 16; integrator on phase error between channels line frequency = 45 hz to 65 hz, hpf on pf = 0.8 capacitive 0.05 degrees phase lead 37 pf = 0.5 inductive 0.05 degrees phase lag 60 ac power supply rejection vdd = 3.3 v + 120 mv rms/120 hz, ipx = vpx = 100 mv rms output frequency variation 0.01 %
ADE7878 rev. 0 | page 6 of 92 parameter 1 , 2 min typ max unit test conditions/comments dc power supply rejection vdd = 3.3 v 330 mv dc output frequency variation 0.01 % total reactive energy measurement bandwidth 2 khz rms measurements i rms and v rms measurement bandwidth 2 khz i rms and v rms measurement error (psm0 mode) 0.1 % over a dynamic range of 1000 to 1, pga = 1 mean absolute value (mav) measurement imav measurement bandwidth (psm1 mode) 260 hz imav measurement error (psm1 mode) 0.5 % over a dynamic range of 100 to 1, pga = 1 analog inputs maximum signal levels 500 mv peak differential inputs between the following pins: iap and ian, ibp and ibn, icp and icn; single-ended inputs between the following pins: vap and vn, vbp and vn, vcp and vn input impedance (dc) iap, ian, ibp, ibn, icp, icn, vap, vbp, vcp pins 400 k vn pin 130 k adc offset error 20 mv pga = 1, uncalibrated error, see the terminology section gain error 4 % external 1.2 v reference waveform sampling sampling clkin/2048, 16.384 mhz/2048 = 8 ksps current and voltage channels see waveform sampling mode section signal-to-noise ratio, snr 70 db pga = 1 signal-to-noise-and-distortion ratio, sinad 65 db pga = 1 bandwidth (?3 db) 2 khz time interval between phases measurement error 0.3 degrees line frequency = 45 hz to 65 hz, hpf on cf1, cf2, cf3 pulse outputs maximum output frequency 8 khz wthr = varthr = vathr = pmax = 33,516,139 duty cycle 50 % if cf1, cf2, or cf3 frequency > 6.25 hz and cfden is even and > 1 (1 + 1/cfden) 50% if cf1, cf2, or cf3 frequency > 6.25 hz and cfden is odd and > 1 active low pulse width 80 ms if cf1, cf2, or cf3 frequency < 6.25 hz jitter 0.04 % for cf1, cf2, or cf3 frequency = 1 hz and nominal phase currents are larger than 10% of full scale reference input ref in/out input voltage range 1.1 1.3 v minimum = 1.2 v ? 8%; maximum = 1.2 v + 8% input capacitance 10 pf on-chip reference nominal 1.2 v at ref in/out pin at t a = 25c psm0 and psm1 modes reference error 0.9 mv max output impedance 1.4 k min temperature coefficient 10 50 ppm/c
ADE7878 rev. 0 | page 7 of 92 parameter 1 , 2 min typ max unit test conditions/comments clkin all specifications clkin of 16.384 mhz input clock frequency 16.384 mhz crystal equivalent series resistance 30 50 k clkin input capacitance 20 pf clkout output capacitance 20 pf logic inputsmosi/sda, sclk/scl, clkin, ss , reset , pm0, and pm1 input high voltage, v inh 2.0 v vdd = 3.3 v 10% input low voltage, v inl 0.8 v vdd = 3.3 v 10% input current, i in ?7.5 a input = 0 v, vdd = 3.3 v 3 a input = vdd = 3.3 v 100 na input = vdd = 3.3 v input capacitance, c in 10 pf logic outputs irq0 , irq1 , miso/hsd, and clkout dvdd = 3.3 v 10% output high voltage, v oh 2.4 v vdd = 3.3 v 10% i source 800 a output low voltage, v ol 0.4 v vdd = 3.3 v 10% i sink 2 ma cf1, cf2, cf3/hsclk output high voltage, v oh 2.4 v vdd = 3.3 v 10% i source 500 a output low voltage, v ol 0.4 v vdd = 3.3 v 10% i sink 2 ma power supply for specified performance psm0 mode vdd pin 3.0 3.6 v minimum = 3.3 v ? 10%; maximum = 3.3 v + 10% i dd 22 24.29 ma psm1 and psm2 modes vdd pin 2.4 3.7 v i dd psm1 mode 4.85 5.61 ma psm2 mode 0.2 0.259 ma psm3 mode for specified performance vdd pin 2.4 3.7 v i dd in psm3 mode 1.62 a 1 see the typical performance characteristics section. 2 see the terminology section for a definition of the parameters.
ADE7878 rev. 0 | page 8 of 92 timing characteristics vdd = 3.3 v 10%, agnd = dgnd = 0 v, on-chip reference, clkin = 16.384 mhz, t min to t max = ?40c to +85c. table 2. i 2 c-compatible interface timing parameter standard mode fast mode parameter symbol min max min max unit scl clock frequency f scl 0 100 0 400 khz hold time (repeated) start condition t hd;sta 4.0 0.6 s low period of scl clock t low 4.7 1.3 s high period of scl clock t high 4.0 0.6 s set-up time for repeated start condition t su;sta 4.7 0.6 s data hold time t hd;dat 0 3.45 0 0.9 s data setup time t su;dat 250 100 ns rise time of both sda and scl signals t r 1000 20 300 ns fall time of both sda and scl signals t f 300 20 300 ns setup time for stop condition t su;sto 4.0 0.6 s bus free time between a stop and start condition t buf 4.7 1.3 s pulse width of suppressed spikes t sp n/a 1 50 ns 1 n/a means not applicable. t f t r t hd;dat t hd;sta t high t su;sta t su;dat t f t hd;sta t sp t su;sto t r t buf t low sda scl k start condition repeated start condition stop condition start condition 08510-002 figure 2. i 2 c-compatible in terface timing
ADE7878 rev. 0 | page 9 of 92 table 3. spi interface timing parameters parameter symbol min max unit ss to sclk edge t ss 50 ns sclk period 400 ns sclk low pulse width t sl 175 ns sclk high pulse width t sh 175 ns data output valid after sclk edge t dav 100 ns data input setup time before sclk edge t dsu 100 ns data input hold time after sclk edge t dhd 5 ns data output fall time t df 20 ns data output rise time t dr 20 ns sclk rise time t sr 20 ns sclk fall time t sf 20 ns miso disable after ss rising edge t dis 200 ns ss high after sclk edge t sfs 0 ns msb lsb lsb in intermediate bits intermediate bits t sfs t dis t ss t sl t df t sh t dhd t dav t dsu t sr t sf t dr msb in mosi miso sclk ss 08510-003 figure 3. spi interface timing
ADE7878 rev. 0 | page 10 of 92 table 4. hsdc interface timing parameter parameter symbol min max unit hsa to sclk edge t ss 0 ns hsclk period 125 ns hsclk low pulse width t sl 50 ns hsclk high pulse width t sh 50 ns data output valid after hsclk edge t dav 40 ns data output fall time t df 20 ns data output rise time t dr 20 ns hsclk rise time t sr 10 ns hsclk fall time t sf 10 ns hsd disable after hsa rising edge t dis 5 ns hsa high after hsclk edge t sfs 0 ns msb lsb intermediate bits t sfs t dis t ss t sl t df t sh t dav t sr t sf t dr hsd hscl k hsa 08510-004 figure 4. hsdc interface timing 2ma i ol 800a i oh 1.6v to output pin c l 50pf 08510-005 figure 5. load circuit for timing specifications
ADE7878 rev. 0 | page 11 of 92 absolute maximum ratings t a = 25c, unless otherwise noted. table 5. absolute maximum ratings parameter rating vdd to agnd ?0.3 v to +3.7 v vdd to dgnd ?0.3 v to +3.7 v analog input voltage to agnd, iap, ian, i b p, i b n , i c p, i c n , va p, v b p, v c p, v n ?2 v to +2 v analog input voltage to inp and inn ?2 v to +2 v reference input voltage to agnd ?0.3 v to vdd + 0.3 v digital input voltage to dgnd ?0.3 v to vdd + 0.3 v digital output voltage to dgnd ?0.3 v to vdd + 0.3 v operating temperature industrial range ?40c to +85c storage temperature range ?65c to +150c junction temperature 150c lead temperature range (soldering, 10 sec) 300c stresses above those listed under absolute maximum ratings may cause permanent damage to the device. this is a stress rating only; functional operation of the device at these or any other conditions above those listed in the operational sections of this specification is not implied. exposure to absolute maximum rating conditions for extended periods may affect device reliability. thermal resistance ja is specified equal to 29.3c/w; jc is specified equal to 1.8c/w. table 6. thermal resistance package type ja jc unit 40-lead lfcsp 29.3 1.8 c/w esd caution
ADE7878 rev. 0 | page 12 of 92 pin configuration and fu nction descriptions pin 1 indicator 1 nc 2 pm0 3 pm1 4 reset 5 dvdd 6 dgnd 7 iap 8 ian 9 ibp 10 nc 23 vap 24 avdd 25 agnd 26 vdd 27 clkin 28 clkout 29 irq0 30 nc notes 1. nc = no connect. 2. the exposed pad should be connected to agnd. 22 vbp 21 nc 11 nc 12 ibn 13 icp 15 inp 17 ref in/out 16 inn 18 vn 19 vcp 20 n c 14 icn 33 cf1 34 cf2 35 cf3/hsclk 36 sclk/scl 37 miso /hsd 38 mos i/sda 39 ss/hsa 40 nc 32 irq1 31 nc top view (not to scale) ADE7878 08510-106 figure 6. pin configuration table 7. pin function descriptions pin no. mnemonic description 1, 10, 11, 20, 21, 30, 31, 40 nc no connect. these pins are not connected internally. 2 pm0 power mode pin 0. this pin, combined with pm1, defines the power mode of the ADE7878, as described in table 8 . 3 pm1 power mode pin 1. this pin defines the power mode of the ADE7878 when combined with pm0, as described in table 8 . 4 reset reset input, active low. in psm0 mode, this pin should stay low for at least 10 s to trigger a hardware reset. 5 dvdd this pin provides access to the on-chip 2.5 v digital ldo. do not connect any external active circuitry to this pin. decouple this pin with a 4.7 f capacitor in parallel with a ceramic 220 nf capacitor. 6 dgnd ground reference. this pin provides the ground reference for the digital circuitry. 7, 8 iap, ian analog inputs for current channel a. th is channel is used with th e current transducers and is referenced in this document as current channel a. these inputs are fully differential voltage inputs with a maximum differential level of 0.5 v. this channel also has an internal pga, equal to the ones on channel b and channel c. 9, 12 ibp, ibn analog inputs for current channel b. this channel is used with the current transducers and is referenced in this document as current channel b. these inputs are fully differential voltage inputs with a maximum differential level of 0.5 v. this channel also has an internal pga equal to the ones on channel c and channel a. 13, 14 icp, icn analog inputs for current channel c. this channel is used with the current transducers and is referenced in this document as current channel c. these inputs are fully differential voltage inputs with a maximum differential level of 0.5 v. this channel also has an internal pga equal to the ones on channel a and channel b. 15, 16 inp, inn analog inputs for neutral current channel n. this channel is used with the current transducers and is referenced in this document as current channe l n. these inputs are fully differential voltage inputs with a maximum differential level of 0.5 v. this channel also has an internal pga, different from the ones found on the a, b, and c channels. 17 ref in/out this pin provides access to the on-chip voltage reference. the on-chip reference has a nominal value of 1.2 v. an external reference source with 1.2 v 8% can also be connected at this pin. in either case, decouple this pin to agnd with a 4.7 f capacitor in parallel with a ceramic 100 nf capacitor. after reset, the on-chip reference is enabled.
ADE7878 rev. 0 | page 13 of 92 pin no. mnemonic description 18, 19, 22, 23 vn, vcp, vbp, vap analog inputs for the voltage channel. this cha nnel is used with the voltage transducer and is referenced as the voltage channel in this docume nt. these inputs are single-ended voltage inputs with a maximum signal level of 0.5 v with respect to vn for specified operation. this channel also has an internal pga. 24 avdd this pin provides access to the on-chip 2.5 v analog low dropout regulator (ldo). do not connect external active circuitry to this pin. decouple this pin with a 4.7 f capacitor in parallel with a ceramic 220 nf capacitor. 25 agnd ground reference. this pin provides the ground reference for the analog circuitry. tie this pin to the analog ground plane or to the quietest ground reference in th e system. use this quiet ground reference for all analog circuitry, for example, antial iasing filters, current, and voltage transducers. 26 vdd suppy voltage. this pin provides the supply voltage. in psm0 (normal power mode), maintain the supply voltage at 3.3 v 10% for specified operation. in psm1 (reduced power mode), psm2 (low power mode), and psm3 (sleep mode), when the ad e7878 is supplied from a battery, maintain the supply voltage between 2.4 v and 3.7 v. decouple this pin to dgnd with a 10 f capacitor in parallel with a ceramic 100 nf capacitor. 27 clkin master clock. an external clock can be provided at this logic input. alternatively, a parallel resonant at-cut crystal can be connected across clkin an d clkout to provide a clock source for the ADE7878. the clock frequency for specified operation is 16.384 mhz. use ceramic load capacitors of a few tens of picofarad with the gate oscillator circ uit. refer to the crystal manufacturers data sheet for load capacitance requirements. 28 clkout a crystal can be connected across this pin and clkin (as previously described with pin 27 in this table) to provide a clock source for the ADE7878 . the clkout pin can drive one cmos load when either an external clock is supplied at clkin or a crystal is being used. 29, 32 irq0 , irq1 interrupt request outputs. these are active low logic outputs. see the interrupts section for a detailed presentation of the even ts that may trigger interrupts. 33, 34, 35 cf1, cf2, cf3/hsclk calibration frequency (cf) logic outputs. these outputs provide power information based on the cf1sel, cf2sel, and cf3sel bits in the cfmode register. these outputs are used for operational and calibration purposes. the full-scale output freque ncy can be scaled by writing to the cf1den, cf2den, and cf3den registers, respectively (see the energy-to-frequency conversion section). cf3 is multiplexed with the serial clock output of the hsdc port. 36 sclk/scl serial clock input for spi port/serial clock input for i 2 c port. all serial data transfers are synchronized to this clock (see the serial interfaces section). this pin has a schmid t trigger input for use with a clock source that has a slow edge transition time, for example, opto-isolator outputs. 37 miso/hsd data out for spi port/data out for hsdc port. 38 mosi/sda data in for spi port/data out for i 2 c port. 39 ss /hsa slave select for spi port/hsdc port active. ep exposed pad connect the exposed pad to agnd.
ADE7878 rev. 0 | page 14 of 92 typical performance characteristics ?0.40 ?0.35 ?0.30 ?0.25 ?0.20 ?0.15 ?0.10 error (%) ?0.05 0 0.05 0.10 0.01 0.1 1 10 100 full-scale current (%) +25c, pf = 1.0 ?40c, pf = 1.0 +85c, pf = 1.0 08510-301 figure 7. total active energy error as percentage of reading (gain = +1, pf = 1) over temperature with internal reference and integrator off ?0.25 ?0.20 ?0.15 ?0.10 ?0.05 0 0.05 0.10 0.15 45 47 49 51 53 55 57 59 61 63 65 line frequency (hz) error (%) pf = 1 pf = +0.5 pf = ?0.5 08510-305 figure 8. total active energy error as percentage of reading (gain = +1, pf = 1) over frequency with internal reference and integrator off ?0.15 ?0.10 ?0.05 0 0.05 0.10 0.15 error (%) 0.01 0.1 1 10 100 full-scale current (%) v dd = 2.97v v dd = 3.30v v dd = 3.63v 08510-306 figure 9. total active energy error as percentage of reading (gain = +1, pf = 1) over power supply with internal reference and integrator off ?0.60 ?0.40 ?0.20 0 0.20 0.40 0.60 0.80 0.1 1 10 100 full-scale current (%) error (%) +25c, pf = 1.0 ?40c, pf = 1.0 +85c, pf = 1.0 08510-308 figure 10. total active energy error as percentage of reading (gain = +16) over temperature with internal reference and integrator on ?0.50 ?0.40 ?0.30 ?0.20 ?0.10 0 0.10 0.20 0.30 0.40 0.01 0.1 1 10 100 full-scale current (%) error (%) +25c, pf = 0 ?40c, pf = 0 +85c, pf = 0 08510-311 figure 11. total reactive energy error as percentage of reading (gain = +1, pf = 0) over temperature with internal reference and integrator off ?0.25 ?0.20 ?0.15 ?0.10 ?0.05 0 0.05 0.10 45 47 49 51 53 55 57 59 61 63 65 line frequency (hz) error (%) pf = 0 pf = +0.5 pf = ?0.5 08510-315 figure 12. total reactive energy error as percentage of reading (gain = +1) over frequency with internal reference and integrator off
ADE7878 rev. 0 | page 15 of 92 ?0.30 ?0.20 ?0.10 0 0.10 0.20 0.30 0.01 0.1 1 10 100 full-scale current (%) error (%) v dd = 2.97v v dd = 3.30v v dd = 3.63v 08510-316 figure 13. total reactive energy error as percentage of reading (gain = +1) over power supply with internal reference and integrator off ?0.40 ?0.30 ?0.20 ?0.10 0 0.10 0.20 0.30 0.40 0.50 0.60 0.1 1 10 100 full-scale current (%) error (%) +25c, pf = 1.0 ?40c, pf = 1.0 +85c, pf = 1.0 08510-318 figure 14. total reactive energy error as percentage of reading (gain = +16) over temperature with internal reference and integrator on ?0.25 ?0.20 ?0.15 ?0.10 ?0.05 0 0.05 0.10 0.15 0.20 error (%) 45 47 49 51 53 55 57 59 61 63 65 line frequency (hz) pf = ?0.5 pf = 1.0 pf = +0.5 08510-335 figure 15. fundamental active energy error as percentage of reading (gain = +1) over frequency with internal reference and integrator off ?0.15 ?0.10 ?0.05 0 0.05 0.10 0.15 0.01 0.10 1.00 10.00 100.00 full-scale current (%) error (%) 08510-337 figure 16. cf fundamental active energy error as a percentage of reading (gain = +1) with internal re ference and integrator off ?0.30 ?0.20 ?0.10 0 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.10 1.00 10.00 100.00 full-scale current (%) error (%) +25c, pf = 1.0 ?40c, pf = 1.0 +85c, pf = 1.0 08510-338 figure 17. fundamental active energy error as percentage of reading (gain = +16) over temperature with internal reference and integrator on ?0.25 ?0.20 ?0.15 ?0.10 ?0.05 0 0.05 0.10 0.15 45 47 49 51 53 55 57 59 61 63 65 line frequency (hz) pf = ?0.5 pf = 1.0 pf = +0.5 error (%) 08510-345 figure 18. fundamental re active energy error as percentage of reading (gain = +1) over frequency with internal reference and integrator off
ADE7878 rev. 0 | page 16 of 92 ?0.15 ?0.10 ?0.05 0 0.05 0.10 0.15 0.01 0.10 1.00 10.00 100.00 full-scale current (%) error (%) 08510-347 ?0.40 ?0.30 ?0.20 ?0.10 0 0.10 0.20 0.30 0.40 0.50 0.10 1.00 10.00 100.00 full-scale current (%) +25c, pf = 1.0 ?40c, pf = 1.0 +85c, pf = 1.0 error (%) 08510-348 figure 19. cf fundamental reactive energy error as a percentage of reading (gain = +1) with internal re ference and integrator off figure 20. fundamental re active energy error as percentage of reading (gain = +16) over temperature with internal reference and integrator on
ADE7878 rev. 0 | page 17 of 92 test circuit same as cf2 pm0 0.22f 4.7f mosi/sda miso/hsd sclk/scl cf3/hsclk cf2 cf1 ref in/out clkout clkin pm1 reset iap ian ibp ibn icp icn vn vcp vbp vap 2 23 3 4 7 8 9 12 13 14 18 19 22 39 38 37 36 35 34 33 32 29 17 28 27 ade7858 24 26 5 avdd vdd dvdd 6 25 dgnd agnd pad 0.1f 10f 0.1f 4.7f 20pf + + + 3.3v 3.3v same as irq0_n 20pf 16.384mhz same as vcp same as vcp same as iap, ian same as iap, ian 1.8nf 1k ? 1k ? 1k ? 10k? 10k? 10k? 1.5k ? 1k ? 1.8nf 3.3v 3.3 v 1f 1.8nf 1.8nf ss/hsa irq1 irq0 08510-099 figure 21. test circuit
ADE7878 rev. 0 | page 18 of 92 terminology measurement error the error associated with the energy measurement made by the ADE7878 is defined by measurement error = %100 7878 ? energytrue energ y true adeb y registere d energ y (1) phase error between channels the high-pass filter (hpf) and digital integrator introduce a slight phase mismatch between the current and the voltage channel. the all digital design ensures that the phase matching between the current channels and voltage channels in all three phases is within 0.1 over a range of 45 hz to 65 hz and 0.2 over a range of 40 hz to 1 khz. this internal phase mismatch can be combined with the external phase error (from current sensor or component tolerance) and calibrated with the phase calibration registers. power supply rejection (psr) this quantifies the ADE7878 measurement error as a percen- tage of reading when the power supplies are varied. for the ac psr measurement, a reading at nominal supplies (3.3 v) is taken. a second reading is obtained with the same input signal levels when an ac signal (120 mv rms at 100 hz) is introduced onto the supplies. any error introduced by this ac signal is expressed as a percentage of readingsee the measurement error definition. for the dc psr measurement, a reading at nominal supplies (3.3 v) is taken. a second reading is obtained with the same input signal levels when the power supplies are varied 10%. any error introduced is expressed as a percentage of the reading. adc offset error this refers to the dc offset associated with the analog inputs to the adcs. it means that with the analog inputs connected to agnd, the adcs still see a dc analog input signal. the magni- tude of the offset depends on the gain and input range selection (see the typical performance characteristics section). however, a hpf removes the offset from the current and voltage channels and the power calculation remains unaffected by this offset. gain error the gain error in the adcs of the ADE7878 is defined as the difference between the measured adc output code (minus the offset) and the ideal output code (see the current channel adc section and the volt age c hannel ad c section). the difference is expressed as a percentage of the ideal code. cf jitter the period of pulses at one of the cf1, cf2, or cf3 pins is continuously measured. the maximum, minimum, and average values of four consecutive pulses are computed as follows: maximum = max ( period 0 , period 1 , period 2 , period 3 ) minimum = min ( period 0 , period 1 , period 2 , period 3 ) average = 4 3 2 1 0 period period period period ++ + the cf jitter is then computed as %100 ? = average m inimum m aximum cf jitter (2)
ADE7878 rev. 0 | page 19 of 92 power management the ADE7878 has four modes of operation, determined by the state of the pm0 and pm1 pins (see table 8 ). these pins provide complete control of the ADE7878 operation and can easily be connected to an external microprocessor i/o. the pm0 and pm1 pins have internal pull-up resistors. table 10 and tabl e 11 list actions that are recommended before and after setting a new power mode. table 8. ADE7878 power supply modes power supply modes pm1 pm0 psm0, normal power mode 0 1 psm1, reduced power mode 0 0 psm2, low power mode 1 0 psm3, sleep mode 1 1 psm0normal power mode in psm0 mode, the ADE7878 is fully functional. the pm0 pin is set to high and the pm1 pin is set to low for the ADE7878 to enter this mode. if the ADE7878 is in one of psm1, psm2, or psm3 modes and is switched into psm0 mode, then all control registers take the default values with the exception of the threshold register, lpoilvl[7:0], which is used in psm2 mode, and the config2[7:0] register, both of which maintain their values. the ADE7878 signals the end of the transition period by triggering the irq1 interrupt pin low and setting bit 15 (rstdone) in the status1[31:0] register to 1. this bit is 0 during the transition period and becomes 1 when the transition is finished. the status bit is cleared and the irq1 pin is set back to high by writing status1[31:0] register with the corresponding bit set to 1. bit 15 (rstdone) in the interrupt mask register does not have any functionality attached even if the irq1 pin goes low when bit 15 (rstdone) in the status1[31:0] register is set to 1. this makes the rstdone interrupt unmaskable. psm1reduced power mode in this mode, the ADE7878 measures the mean absolute values (mav) of the 3-phase currents and stores the results in the aimav[19:0], bimav[19:0], and cimav[19:0] 20-bit registers. this mode is useful in missing neutral cases in which the voltage supply of the ADE7878 is provided by an external battery. the serial ports, i 2 c or spi, are enabled in this mode and the active port can be used to read the aimav, bimav, and cimav registers. it is not recommended to read any of the other registers because their values are not guaranteed in this mode. similarly, a write operation is not taken into account by the ADE7878 in this mode. in summary, in this mode, it is not recommended to access any register other than aimav, bimav, and cimav. the circuit that measures these estimates of rms values is also active during psm0; therefore, its calibration can be completed in either psm0 mode or in psm1 mode. note that the ADE7878 does not provide any register to store or process the corrections resulting from the calibration process. the external microprocessor should store the gain values in connection with these measurements and use them during psm1 (see the current mean absolute value calculation section for more details on the ximav registers). the 20-bit mean absolute value measurements done in psm1, although available also in psm0, are different from the rms measurements of phase currents and voltages executed only in psm0 and stored in xirms and xvrms 24-bit registers. see the current mean absolute value calculation section for details. if the ADE7878 is set in psm1 mode while still in psm0, the ADE7878 immediately begins the mean absolute value calcula- tions without any delay. the ximav registers can be accessed at any time; however, if the ADE7878 is set in psm1 mode while still in psm2 or psm3 modes, the ADE7878 signals the start of the mean absolute value computations by triggering the irq1 pin low. the ximav registers can be accessed only after this moment. psm2low power mode in this mode, the ADE7878 compares all phase currents against a threshold for a period of 0.02 (lpline + 1) seconds, independent of the line frequency. lpline are bits[7:3] of the lpoilvl[7:0] register (see table 9 ). table 9. lpoilvl register bit mnemonic default description [2:0] lpoil 111 threshold is put at a value corresponding to full scale multiplied by lpoil/8. [7:3] lpline 00000 the measurement period is (lpline + 1)/50 sec. the threshold is derived from bits[2:0] (lpoil) of the lpoilvl[7:0] register as lpoil/8 of full scale. every time one phase current becomes greater than the threshold, a counter is incremented. if every phase counter remains below lpline + 1 at the end of the measurement period, then the irq0 pin is triggered low. if a single phase counter becomes greater or equal to lpline + 1 at the end of the measurement period, the irq1 pin is triggered low. illustrates how the ADE7878 behaves in psm2 mode when lpline = 2 and lpoil = 3. the test period is three 50 hz cycles (60 ms), and the phase a current rises above the lpoil threshold three times. at the end of the test period, the figure 22 irq1 pin is triggered low. the i 2 c or spi port is not functional during this mode. the psm2 mode reduces the power consumption required to mon- itor the currents when there is no voltage input and the voltage supply of the ADE7878 is provided by an external battery. if the
ADE7878 rev. 0 | page 20 of 92 0 irq pin is triggered low at the end of a measurement period, this signifies all phase currents stayed below threshold and, therefore, there is no current flowing through the system. at this point, the external microprocessor should set the ADE7878 in sleep mode psm3. if the 1 irq pin is triggered low at the end of the measurement period, this signifies that at least one current input is above the defined threshold and current is flowing through the system, although no voltage is present at the ADE7878 pins. this situation is often called missing neutral and is considered a tampering situation, at which point the external microprocessor should set the ADE7878 in psm1 mode, measure mean absolute values of phase currents, and integrate the energy based on their values and the nominal voltage. it is recommended to use the ADE7878 in psm2 mode when bits[2:0] (pga1) of the gain[15:0] register are equal to 1 or 2. these bits represent the gain in the current channel datapath. it is not recommended to use the ADE7878 in psm2 mode when the pga1 bits are equal to 4, 8, or 16. phase counter = 1 phase counter = 2 phase counter = 3 lpline = 2 irq 1 ia curren t lpoil threshold 08510-008 figure 22. psm2 mode triggering irq1 pin for lpline = 2, 50 hz systems psm3sleep mode in this mode, the ADE7878 has most of the internal circuits turned off and the current consumption is at its lowest level. the i 2 c, hsdc, and spi ports are not functional during this mode, and the reset , sclk/scl, mosi/sda, and ss /hsa pins should be set high. power-up procedure the ADE7878 contains an on-chip power supply monitor that supervises the power supply (vdd). at power-up, until vdd reaches 2 v 10%, the chip is in an inactive state. as vdd crosses this threshold, the power supply monitor keeps the chip in this inactive state for an additional 26 ms, allowing vdd to achieve 3.3 v ? 10%, the minimum recommended supply voltage. because the pm0 and pm1 pins have internal pull-up resistors and the external microprocessor keeps them high, the ADE7878 always powers-up in sleep mode (psm3). then, an external circuit (that is, a microprocessor) sets the pm1 pin to a low level, allowing the ADE7878 to enter normal mode (psm0). the passage from psm3 mode, in which most of the internal circuitry is turned off, to psm0 mode, in which all functionality is enabled, is accomplished in less than 40 ms (see figure 23 for details). when the ADE7878 enters psm0 mode, the i 2 c port is the active serial port. if the spi port is used, then the ss /hsa pin must be toggled three times high to low. this action selects the spi port for further use. if i 2 c is the active serial port, bit 1 (i2c_lock) of config2[7:0] must be set to 1 to lock it in. from this moment, the ADE7878 ignores spurious toggling of the ss /hsa pin, and an eventual switch to use the spi port is no longer possible. likewise, if spi is the active serial port, any write to the config2[7:0] register locks the port, at which time a switch to use the i 2 c port is no longer possible. por timer turned on ADE7878 powered up ADE7878 enter psm3 microprocessor sets ADE7878 in psm0 microprocessor makes the choice between i 2 c and spi rstdone interrupt triggered 40ms 26ms 0v 3.3v ? 10% 2.0v 10% ADE7878 psm0 ready 08510-009 figure 23. power-up procedure
ADE7878 rev. 0 | page 21 of 92 only a power-down or setting the reset pin low can reset the ADE7878 to use the i 2 c port. once locked, the serial port choice is maintained when the ADE7878 changes psmx power modes. immediately after entering psm0, theADE7878 sets all regis- ters to their default values, including config2[7:0] and lpoilvl[7:0]. the ADE7878 signals the end of the transition period by triggering the irq1 interrupt pin low and setting bit 15 (rstdone) in the status1[31:0] register to 1. this bit is 0 during the transition period and becomes 1 when the tran- sition ends. the status bit is cleared and the irq1 pin is returned high by writing the status1[31:0] register with the corresponding bit set to 1. because the rstdone is an unmaskable interrupt, bit 15 (rstdone) in the status1[31:0] register must be cancelled for the irq1 pin to return high. it is recommended to wait until the irq1 pin goes low before accessing the status1[31:0] register to test the state of the rstdone bit. at this point, as a good programming practice, it is also recommended to cancel all other status flags in the status1[31:0] and status0[31:0] registers by writing the corresponding bits with 1. initially, the dsp is in idle mode, which means it does not execute any instruction. this is the moment to initialize all ADE7878 registers and then write 0x0001 into the run[15:0] register to start the dsp (see the digital signal processor section for details on the run[15:0] register). if the supply voltage, vdd, drops lower than 2 v 10%, the ADE7878 enters an inactive state, which means that no measurements and computations are executed. hardware reset the ADE7878 has a reset pin. if the ADE7878 is in psm0 mode and the reset pin is set low, then the ADE7878 enters the hardware reset state. the ADE7878 must be in psm0 mode for a hardware reset to be considered. setting the reset pin low while the ADE7878 is in psm1, psm2, and psm3 modes does not have any effect. if the ADE7878 is in psm0 mode and the reset pin is toggled from high to low and then back to high after at least 10 s, all the registers are set to their default values, including config2[7:0] and lpoilvl[7:0]. the ADE7878 signals the end of the transi- tion period by triggering the irq1 interrupt pin low and setting bit 15 (rstdone) in the status1[31:0] register to 1. this bit is 0 during the transition period and becomes 1 when the tran- sition ends. the status bit is cleared and the irq1 pin is returned high by writing to the status1[31:0] register with the corresponding bit set to 1. after a hardware reset, the dsp is in idle mode, which means it does not execute any instruction. because the i 2 c port is the default serial port of theADE7878, it becomes active after a reset state. if spi is the port used by the external microprocessor, the procedure to enable it must be repeated immediately after the reset pin is toggled back to high (see the section for details). serial interfaces at this point, it is recommended to initialize all of the ADE7878 registers and then write 0x0001 into the run[15:0] register to start the dsp. see the digital signal processor section for details on the run[15:0] register. software reset functionality bit 7 (swrst) in the config[15:0] register manages the soft- ware reset functionality in psm0 mode. the default value of this bit is 0. if this bit is set to 1, then the ADE7878 enters a software reset state. in this state, almost all internal registers are set to their default values. in addition, the choice of what serial port, i 2 c or spi, is in use remains unchanged if the lock-in procedure has been previously executed (see the serial interfaces for details). the registers that maintain their values despite the swrst bit being set to 1 are config2[7:0] and lpoilvl[7:0]. when the software reset ends, bit 7 (swrst) in config[15:0] is cleared to 0, the irq1 interrupt pin is set low, and bit 15 (rstdone) in the status1[31:0] register is set to 1. this bit is 0 during the transition period and becomes 1 when the transition ends. the status bit is cleared and the irq1 pin is set back high by writing to the status1[31:0] register with the corresponding bit set to 1. after a software reset ends, the dsp is in idle mode, which means it does not execute any instruction. it is recommended to initialize all the ADE7878 registers and then write 0x0001 into the run[15:0] register to start the dsp (see the digital signal processor section for details on the run[15:0] register). software reset functionality is not available in psm1, psm2, or psm3 mode.
ADE7878 rev. 0 | page 22 of 92 table 10. power modes and related characteristics power mode all registers 1 lpoilvl, config2 i 2 c/spi functionality psm0 state after hardware reset set to default set to default i 2 c enabled all circuits are active and dsp is in idle mode. state after software reset set to default unchan ged active serial port is unchanged if lock in procedure has been previously executed all circuits are active and dsp is in idle mode. psm1 not available values set during psm0 unchanged. enabled current mean absolute values are computed and the results are stored in the aimav, bimav, and cimav registers. the i 2 c or spi serial port is enabled with limited functionality. psm2 not available values set during psm0 unchanged disabled compares phase currents against the threshold set in lpoilvl. triggers irq0 or irq1 pins accordingly. the serial ports are not available. psm3 not available values set during psm0 unchanged disabled internal circuits shut down and the serial ports are not available. 1 setting for all registers except the lpoilvl and config2 registers.
ADE7878 rev. 0 | page 23 of 92 table 11. recommended actions when changing power modes initial power mode recommended actions before setting next power mode next power mode psm0 psm1 psm2 psm3 psm0 stop dsp by setting run[15:0] = 0x0000. current mean absolute values (mav) computed immediately. wait until the irq0 or irq1 pin is triggered accordingly. no action necessary. disable hsdc by clearing bit 6 (hsden) to 0 in the config[15:0] register. ximav[19:0] registers may be accessed immediately. mask interrupts by setting mask0[31:0] = 0x0 and mask1[31:0] = 0x0. erase interrupt status flags in the status0[31:0] and status1[31:0] registers. psm1 no action necessary. wait until the irq1 pin is triggered low. wait until the irq0 or irq1 pin is triggered accordingly. no action necessary. poll the status1[31:0] register until bit 15 (rstdone) is set to 1. psm2 no action necessary. wait until the irq1 pin is triggered low. wait until the irq1 pin triggered low. no action necessary. poll the status1[31:0] register until bit 15 (rstdone) is set to 1. current mean absolute values are computed beginning this moment. ximav[19:0] registers may be accessed from this moment. psm3 no action necessary. wait until the irq1 pin is triggered low. wait until the irq1 pin is triggered low. wait until the irq0 or irq1 pin is triggered accordingly. poll the status1[31:0] register until bit 15 (rstdone) is set to 1. current mav circuit begins computations at this time. ximav[19:0] registers can be accessed from this moment.
ADE7878 rev. 0 | page 24 of 92 theory of operation analog inputs the ADE7878 has seven analog inputs forming current and voltage channels. the current channels consist of four pairs of fully differential voltage inputs: iap and ian, ibp and ibn, icp and icn, and inp and inn. these voltage input pairs have a maximum differential signal of 0.5 v. in addition, the maximum signal level on analog inputs for ixp/ixn is 0.5 v with respect to agnd. the maximum common-mode signal allowed on the inputs is 25 mv. figure 24 presents a schematic of the current channels inputs and their relation to the maximum common-mode voltage. all inputs have a programmable gain amplifier (pga) with a possible gain selection of 1, 2, 4, 8, or 16. the gain of ia, ib, and ic inputs is set in bits[2:0] (pga1) of the gain[15:0] register. the gain of the in input is set in bits[5:3] (pga2) of the gain[15:0] register; thus, a different gain from the ia, ib, or ic inputs is possible. see table 38 for details on the gain[15:0] register. the voltage channel has three single-ended voltage inputs: vap, vbp, and vcp. these single-ended voltage inputs have a maximum input voltage of 0.5 v with respect to vn. in addition, the max- imum signal level on analog inputs for vxp and vn is 0.5 v with respect to agnd. the maximum common-mode signal allowed on the inputs is 25 mv. figure 26 presents a schematic of the voltage channels inputs and their relation to the maximum common-mode voltage. all inputs have a programmable gain with a possible gain selection of 1, 2, 4, 8, or 16. the setting is done using bits[8:6] (pga3) in the gain[15:0] register (see tabl e 38 ). figure 25 shows how the gain selection from the gain[15:0] register works in both current and voltage channels. iap, ibp, icp or inp ian, ibn, icn or inn v cm v 2 v 1 + 500m v v cm v 1 + v 2 differential inpu t v 1 + v 2 = 500mv max peak common mode v cm = 25mv max ? 500m v 08510-010 figure 24. maximum input level, current channels, gain = 1 analog-to-digital conversion the ADE7878 has seven sigma-delta (-) analog-to-digital converters (adcs). in psm0 mode, all adcs are active. in psm1 mode, the adcs that measure the phase a, phase b, and phase c currents only are active. the adcs that measure the neutral current and the a, b, and c phase voltages are turned off. in psm2 and psm3 modes, the adcs are powered down to minimize power consumption. for simplicity, the block diagram in figure 27 shows a first- order - adc. the converter is made up of the - modulator and the digital low-pass filter. a - modulator converts the input signal into a continuous serial stream of 1s and 0s at a rate determined by the sampling clock. in the ADE7878, the sampling clock is equal to 1.024 mhz (clkin/16). the 1-bit dac in the feedback loop is driven by the serial data stream. the dac output is subtracted from the input signal. if the loop gain is high enough, the average value of the dac output (and therefore the bit stream) can approach that of the input signal level. for any given input value in a single sampling interval, the data from the 1-bit adc is virtually meaningless. only when a large number of samples is averaged is a meaningful result obtained. this averaging is carried out in the second part of the adc, the digital low-pass filter. by averaging a large number of bits from the modulator, the low-pass filter can produce 24-bit data-words that are proportional to the input signal level. k v in gain selection ixn, vn ixp, vyp v in notes 1. x = a, b, c, n y = a, b, c. 08510-011 figure 25. pga in current and voltage channels vap, vbp or vcp vn v cm v 1 + 500m v v cm v 1 differential input v 1 + v 2 = 500mv max peak common mode v cm = 25mv max ? 500m v 08510-012 figure 26. maximum input level, voltage channels, gain = 1 24 digital low-pass filter r c + ? clkin/16 integrator v ref 1-bit dac latched comparator analog low-pass filter .....10100101..... + ? 08510-013 figure 27. first-order - adc
ADE7878 rev. 0 | page 25 of 92 the - converter uses two techniques to achieve high resolu- tion from what is essentially a 1-bit conversion technique. the first is oversampling. oversampling means that the signal is sampled at a rate (frequency) that is many times higher than the bandwidth of interest. for example, the sampling rate in the ADE7878 is 1.024 mhz, and the bandwidth of interest is 40 hz to 2 khz. oversampling has the effect of spreading the quantization noise (noise due to sampling) over a wider band- width. with the noise spread more thinly over a wider bandwidth, the quantization noise in the band of interest is lowered, as shown in figure 28 . however, oversampling alone is not efficient enough to improve the signal-to-noise ratio (snr) in the band of interest. for example, an oversampling ratio of 4 is required just to increase the snr by only 6 db (1 bit). to keep the over- sampling ratio at a reasonable level, it is possible to shape the quantization noise so that the majority of the noise lies at the higher frequencies. in the - modulator, the noise is shaped by the integrator, which has a high-pass-type response for the quantization noise. this is the second technique used to achieve high resolution. the result is that most of the noise is at the higher frequencies where it can be removed by the digital low- pass filter. this noise shaping is shown in figure 28 . noise signal noise signal 0 2 4 512 frequency (khz) high resolution output from digital lpf 1024 0 2 4 512 frequency (khz) 1024 digital filter shaped noise antialias filter (rc) sampling frequency 08510-014 figure 28. noise reduction due to oversampling and noise shaping in the analog modulator antialiasing filter figure 27 also shows an analog low-pass filter (rc) on the input to the adc. this filter is placed outside the ADE7878, and its role is to prevent aliasing. aliasing is an artifact of all sampled systems and is illustrated in figure 29 . aliasing means that frequency components in the input signal to the adc, which are higher than half the sampling rate of the adc, appear in the sampled signal at a frequency below half the sampling rate. frequency components above half the sampling frequency (also known as the nyquist frequency, that is, 512 khz) are imaged or folded back down below 512 khz. this happens with all adcs regardless of the architecture. in the example shown, only frequencies near the sampling frequency, that is, 1.024 mhz, move into the band of interest for metering, that is, 40 hz to 2 khz. to attenuate the high frequency (near 1.024 mhz) noise and prevent the distortion of the band of interest, a low-pass filer (lpf) must be introduced. for conventional current sensors, it is recommended to use one rc filter with a corner frequency of 5 khz for the attenuation to be sufficiently high at the sampling frequency of 1.024 mhz. the 20 db per decade attenuation of this filter is usually sufficient to eliminate the effects of aliasing for conventional current sensors. however, for a di/dt sensor such as a rogowski coil, the sensor has a 20 db per decade gain. this neutralizes the 20 db per decade attenuation produced by the lpf. therefore, when using a di/dt sensor, take care to offset the 20 db per decade gain. one simple approach is to cascade one additional rc filter; thus, a ?40 db per decade attenuation is produced. a liasing effects sampling frequency image frequencies 0 2 4 512 frequency (khz) 1024 08510-015 figure 29. aliasing effects adc transfer function all adcs in the ADE7878 are designed to produce the same 24-bit signed output code for the same input signal level. with a full-scale input signal of 0.5 v and an internal reference of 1.2 v, the adc output code is nominally 5,928,256 (0x5a7540). the code from the adc may vary between 0x800000 (?8,388,608) and 0x7fffff (+8,388,607); this is equivalent to an input signal level of 0.707 v. however, for specified performance, it is recommended not to exceed the nominal range of 0.5 v. the adc performance is guaranteed only for input signals lower than 0.5 v. current channel adc figure 30 shows the adc and signal processing path for input ia of the current channels (it is the same for ib and ic). the adc outputs are signed twos complement 24-bit data- words and are available at a rate of 8 ksps (thousand samples per second). with the specified full-scale analog input signal of 0.5 v, the adc produces its maximum output code value. figure 30 shows a full-scale voltage signal applied to the differ- ential inputs (iap and ian). the adc output swings between ?5,928,256 (0xa58ac0) and +5,928,256 (0x5a7540). the input, in, corresponds to the neutral current of a 3-phase system. if no neutral line is present, then connect this input to agnd. the datapath of the neutral current is similar to the path of the phase currents and is presented in figure 31 .
ADE7878 rev. 0 | page 26 of 92 aigain[23:0] dsp reference hpfdis [23:0] digital integrator inten bit config[0] total/fundamental active and reactive power calculation current peak, overcurrent detect iawv waveform sample register current rms (irms) calculation hpf adc pga1 iap zx detection pga1 bits gain[2:0] 1, 2, 4, 8, 16 v in v in ian analog input range analog output range 0x5a7540 = +5,928,256 zx sign a l data range 0v 0xa58ac0 = ?5,928,256 0x5a7540 = +5,928,256 current channe l data range after integration 0v 0xa58ac0 = ?5,928,256 0x5a7540 = +5,928,256 current channe l data range 0v 0xa58ac0 = ?5,928,256 +0.5v/gain ?0.5v/gain 0v lpf1 08510-019 figure 30. current channel signal path nigain[23:0] dsp reference digital integrator inten bit config[0] inwv waveform sample register current rms (irms) calculation hpf adc pga2 inp pga2 bits gain[5:3] 1, 2, 4, 8, 16 v in inn 08510-120 figure 31. neutral current signal path current waveform gain registers there is a multiplier in the signal path of each phase and neutral current. the current waveform can be changed by 100% by writing a correspondent twos complement number to the 24-bit signed current waveform gain registers (aigain[23:0], bigain[23:0], cigain[23:0], and nigain[23:0]). for example, if 0x400000 is written to those registers, the adc output is scaled up by 50%. to scale the input by ?50%, write 0xc00000 to the registers. equation 3 describes mathematically the function of the current waveform gain registers. current waveform = ? ? ? ? ? ? ? ? + 23 2 1 register gain currentofcontent outputadc (3) changing the content of aigain[23:0], bigain[23:0], cigain[23:0], or ingain[23:0] affects all calculations based on its current; that is, it affects the corresponding phase active/ reactive/apparent energy and current rms calculation. in addition, waveform samples scale accordingly. note that the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words, and the dsp works on 28 bits. the 24-bit aigain, bigain, cigain, and nigain registers are accessed as 32-bit registers with the four most significant bits (msbs) padded with 0s and sign extended to 28 bits. see figure 32 for details. 31 28 27 24 23 0 24-bit number 0000 bits[27:24] are equal to bit 23 bit 23 is a sign bit 08510-016 figure 32. 24-bit xigain transmitted as 32-bit words current channel hpf the adc outputs can contain a dc offset. this offset can create errors in power and rms calculations. high-pass filters (hpfs) are placed in the signal path of the phase and neutral currents and of the phase voltages. if enabled, the hpf eliminates any dc offset on the current channel. all filters are implemented in the dsp and, by default, they are all enabled: the 24-bit hpfdis[23:0] register is cleared to 0x00000000. all filters are disabled by setting hphdis[23:0] to any non zero value. as previously stated, the serial ports of the ADE7878 work on 32-, 16- or 8-bit words. the hpfdis register is accessed as a 32-bit register with eight msbs padded with 0s. see figure 33 for details. 31 24 23 0 24-bit number 0000 0000 08510-017 figure 33. 24-bit hpfdis register transmitted as 32-bit word
ADE7878 rev. 0 | page 27 of 92 current channel sampling the waveform samples of the current channel are taken at the output of hpf and stored into the iawv, ibwv, icwv, and inwv 24-bit signed registers at a rate of 8 ksps. all power and rms calculations remain uninterrupted during this process. bit 17 (dready) in the status0[31:0] register is set when the iawv, ibwv, icwv, and inwv registers are available to be read using the i 2 c or spi serial port. setting bit 17 (dready) in the mask0[31:0] register enables an interrupt to be set when the dready flag is set. see the digital signal processor section for more details on bit dready. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. when the iawv, ibwv, icwv, and inwv 24-bit signed registers are read from the ADE7878, they are transmitted sign extended to 32 bits. see figure 34 for details. 31 24 23 22 0 24-bit signed number bits[31:24] are equal to bit 23 bit 23 is a sign bit 08510-018 figure 34. 24-bit ixwv register transmitted as 32-bit signed word the ADE7878 contains a high speed data capture (hsdc) port that is specially designed to provide fast access to the waveform sample registers. see the hsdc interface section for more details. di/dt curent sensor and digital integrator the di/dt sensor detects changes in the magnetic field caused by the ac current. figure 35 shows the principle of a di/dt current sensor. magnetic field created by current (directly proportional to current) + emf (electromotive force) ? induced by changes in magnetic flux density (di/dt) 08510-020 figure 35. principle of a di/dt current sensor the flux density of a magnetic field induced by a current is directly proportional to the magnitude of the current. the changes in the magnetic flux density passing through a conductor loop generate an electromotive force (emf) between the two ends of the loop. the emf is a voltage signal that is propor- tional to the di/dt of the current. the voltage output from the di/dt current sensor is determined by the mutual inductance between the current carrying conductor and the di/dt sensor. due to the di/dt sensor, the current signal needs to be filtered before it can be used for power measurement. on each phase and neutral current datapath, there is a built-in digital integrator to recover the current signal from the di/dt sensor. the digital inte- grator is disabled by default when the ADE7878 is powered up and after reset. setting bit 0 (inten) of the config[15:0] register turns on the integrator. figure 36 and figure 37 show the magnitude and phase response of the digital integrator. note that the integrator has a ?20 db/dec attenuation and approximately ?90 phase shift. when combined with a di/dt sensor, the resulting magnitude and phase response should be a flat gain over the frequency band of interest. however, the di/dt sensor has a 20 db/dec gain associated with it and generates sig- nificant high frequency noise. an antialiasing filter of at least the second order is needed to avoid noise aliasing back in the band of interest when the adc is sampling (see the antialiasing filter section). 50 0 ?50 ?100 ?50 0 magnitude (db) phase (degrees) 0 500 1000 1500 2000 2500 3000 3500 4000 frequency (hz) 0.01 0.1 1 10 100 1000 frequency (hz) 08510-116 figure 36. combined gain and phase response of the digital integrator the dicoeff[23:0] 24-bit signed register is used in the digital integrator algorithm. at power-up or after a reset, its value is 0x000000. before turning on the integrator, this register must be initialized with 0xff8000. dicoeff[23:0] is not used when the integrator is turned off and can remain at 0x000000 in that case. ?30 ? 15 ?20 ?25 ?89.96 ?89.97 ?89.98 ?89.99 magnitude (db) phase (degrees) 30 35 40 45 50 55 60 65 70 frequency (hz) 30 35 40 45 50 55 60 65 70 frequency (hz) 0 8510-101 figure 37. combined gain and phase response of the digital integrator (40 hz to 70 hz) as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. similar to the registers shown in figure 32 , the
ADE7878 rev. 0 | page 28 of 92 dicoeff[23:0] 24-bit signed register is accessed as a 32-bit register with four msbs padded with 0s and sign extended to 28 bits, which practically means it is transmitted equal to 0xfff8000. when the digital integrator is switched off, the ADE7878 can be used directly with a conventional current sensor, such as a current transformer (ct). voltage channel adc figure 38 shows the adc and signal processing chain for input va in the voltage channel. the vb and vc channels have similar processing chains. the adc outputs are signed twos complement 24-bit words and are available at a rate of 8 ksps. with the specified full-scale analog input signal of 0.5 v, the adc produces its maximum output code value. figure 38 shows a full-scale voltage signal being applied to the differential inputs (va and vn). the adc output swings between ?5,928,256 (0xa58ac0) and +5,928,256 (0x5a7540). voltage waveform gain registers there is a multiplier in the signal path of each phase voltage. the voltage waveform can be changed by 100% by writing a corresponding twos complement number to the 24-bit signed current waveform gain registers (avgain[23:0], bvgain[23:0], and cvgain[23:0]). for example, if 0x400000 is written to those registers, the adc output is scaled up by 50%. to scale the input by ?50%, write 0xc00000 to the registers. equation 4 describes mathematically the function of the current waveform gain registers. voltage waveform = ? ? ? ? ? ? ? ? + 23 2 1 register gain voltageofcontent outputadc (4) changing the content of avgain[23:0], bvgain[23:0], and cvgain[23:0] affects all calculations based on its voltage; that is, it affects the corresponding phase active/reactive/apparent energy and voltage rms calculation. in addition, waveform samples are scaled accordingly. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words, and the dsp works on 28 bits. as presented in figure 32 , the avgain, bvgain, and cvgain registers are accessed as 32-bit registers with four msbs padded with 0s and sign extended to 28 bits. voltage channel hpf as explained in the current channel hpf section, the adc outputs can contain a dc offset that can create errors in power and rms calculations. hpfs are placed in the signal path of the phase voltages, similar to the ones in the current channels. the hpfdis[23:0] register can enable or disable the filters. see the current channel hpf section for more details. voltage channel sampling the waveform samples of the current channel are taken at the output of hpf and stored into vawv, vbwv, and vcwv 24-bit signed registers at a rate of 8 ksps. all power and rms calculations remain uninterrupted during this process. bit 17 (dready) in the status0[31:0] register is set when the vawv, vbwv, and vcwv registers are available to be read using the i 2 c or spi serial port. setting bit 17 (dready) in the mask0[31:0] register enables an interrupt to be set when the dready flag is set. see the digital signal processor section for more details on bit dready. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. similar to registers presented in figure 34 , the vawv, vbwv, and vcwv 24-bit signed registers are transmitted sign extended to 32 bits. the ADE7878 contains an hsdc port that is specially designed to provide fast access to the waveform sample registers. see the hsdc interface section for more details.
ADE7878 rev. 0 | page 29 of 92 avgain[23:0] reference hpfdis [23:0] dsp total/fundamental active and reactive power calculation v olt a ge peak, overvoltage, sag detect vawv waveform sample register current rms (vrms) calculation hpf adc pga3 vap zx detection pga3 bits gain[8:6] 1, 2, 4, 8, 16 v in v in vn analog input range analog output range 0x5a7540 = +5,928,256 zx signal data range 0v 0xa58ac0 = ?5,928,256 0x5a7540 = +5,928,256 voltage channel data range 0v 0xa58ac0 = ?5,928,256 +0.5v/gain ?0.5v/gain 0v lpf1 08510-025 figure 38. voltage channel datapath changing phase voltage datapath the ADE7878 can direct one phase voltage input to the computa- tional datapath of another phase. for example, phase a voltage can be introduced in the phase b computational datapath, which means all powers computed by the ADE7878 in phase b are based on phase a voltage and phase b current. bits[9:8] (vtoia[1:0]) of the config[15:0] register manage the phase a voltage measured at the va pin. if vtoia[1:0] = 00 (default value), the voltage is directed to the phase a computa- tional datapath, if vtoia[1:0] = 01, the voltage is directed to the phase b path, and if vtoia[1:0] = 10, the voltage is directed to the phase c path. if vtoia[1:0] = 11, the ADE7878 behaves as if vtoia[1:0] = 00. bits[11:10] (vtoib[1:0]) of the config[15:0] register manage the phase b voltage measured at the vb pin. if vtoib[1:0] = 00 (default value), the voltage is directed to the phase b computa- tional datapath, if vtoib[1:0] = 01, the voltage is directed to the phase c path, and if vtoib[1:0] = 10, the voltage is directed to the phase a path. if vtoib[1:0] = 11, the ADE7878 behaves as if vtoib[1:0] = 00. bits[3:12] (vtoic[1:0]) of the config[15:0] register manage the phase c voltage measured at the vc pin. if vtoic[1:0] = 00 (default value), the voltage is directed to phase c computational datapath, if vtoic[1:0] = 01, the voltage is directed to the phase a path, and if vtoic[1:0] = 10, the voltage is directed to the phase b path. if vtoic[1:0] = 11, the ADE7878 behaves as if vtoic[1:0] = 00. i a va ib vb ic vc phase a computational data path phase b computational data path phase c computational data path vtoia[1:0] = 01, phase a voltage directed to phase b vtoib[1:0] = 01, phase b voltage directed to phase c vtoic[1:0] = 01, phase c voltage directed to phase a cphcal bphcal aphcal 08510-026 figure 39. phase voltages used in different datapaths figure 39 presents the case in which phase a voltage is used in the phase b datapath, phase b voltage is used in the phase c datapath, and phase c voltage is used in the phase a datapath. power quality measurements zero-crossing detection the ADE7878 has a zero-crossing (zx) detection circuit on the phase current and voltage channels. the neutral current datapath does not contain a zero-crossing detection circuit. zero-crossing events are used as a time base for various power quality measurements and in the calibration process. a zero crossing is generated from the output of lpf1. the low- pass filter is intended to eliminate all harmonics of 50 hz and 60 hz systems and help identify the zero-crossing events on the fundamental components of both current and voltage channels.
ADE7878 rev. 0 | page 30 of 92 the digital filter has a pole at 80 hz and is clocked at 256 khz. as a result, there is a phase lag between the analog input signal (one of ia, ib, ic, va, vb, and vc) and the output of lpf1. the error in zx detection is 0.0703 for 50 hz systems (0.0843 for 60 hz systems). the phase lag response of lpf1 results in a time delay of approximately 31.4 or 1.74 ms (at 50 hz) between its input and output. the overall delay between the zero crossing on the analog inputs and zx detection obtained after lpf1 is about 39.6 or 2.2 ms (at 50 hz). the adc and hpf introduce the additional delay. the lpf1 cannot be disabled to assure a good resolution of the zx detection. figure 40 shows how the zero-crossing signal is detected. gain[23:0] reference hpfdis [23:0] dsp hpf pga adc ia, ib, ic, or va, vb, vc zx detection lpf1 ia, ib, ic, or va, vb, vc 39.6 or 2.2ms @ 50hz 1 0.855 0v zx zx zx zx lpf1 output 0 8510-027 figure 40. zero-crossing detection on voltage and current channels to provide further protection from noise, input signals to the voltage channel with amplitude lower than 10% of full scale do not generate zero-crossing events at all. the current channel zx detection circuit is active for all input signals independent of their amplitudes. the ADE7878 contains six zero-crossing detection circuits, one for each phase voltage and current channel. each circuit drives one flag in the status1[31:0] register. if a circuit placed in the phase a voltage channel detects one zero-crossing event, then bit 9 (zxva) in the status1[31:0] register is set to 1. similarly, the phase b voltage circuit drives bit 10 (zxvb), the phase c voltage circuit drives bit 11 (zxvc), and circuits placed in the current channel drive bit 12 (zxia), bit 13 (zxib), and bit 14 (zxic). if a zx detection bit is set in the mask1[31:0] register, the irq1 interrupt pin is driven low and the corres- ponding status flag is set to 1. the status bit is cleared and the irq1 pin is set to high by writing to the status1 register with the status bit set to 1. zero-crossing timeout every zero-crossing detection circuit has an associated timeout register. this register is loaded with the value written into the 16-bit zxtout register and is decremented (1 lsb) every 62.5 s (16 khz clock). the register is reset to the zxtout value every time a zero crossing is detected. the default value of this register is 0xffff. if the timeout register decrements to 0 before a zero crossing is detected, then one of bits[8:3] of the status1[31:0] register is set to 1. bit 3 (zxtova), bit 4 (zxtovb), and bit 5 (zxtovc) refer to phase a, phase b, and phase c of the voltage channel; bit 6 (zxtoia), bit 7 (zxtoib), and bit 8 (zxtoic) refer to phase a, phase b, and phase c of the current channel. if a zxtout bit is set in the mask1[31:0] register, the irq1 interrupt pin is driven low when the corresponding status bit is set to 1. the status bit is cleared and the irq1 pin is returned to high by writing to the status1 register with the status bit set to 1. the resolution of the zxout register is 62.5 s (16 khz clock) per lsb. thus, the maximum timeout period for an interrupt is 4.096 sec: 2 16 /16 khz. figure 41 shows the mechanism of the zero-crossing timeout detection when the voltage or the current signal stays at a fixed dc level for more than 62.5 zxtout s. 16-bit internal register value zxtout voltage or current signal irq1 interrupt pin zxzoxy flag in s tatus1[31:0], x = v, a y = a, b, c 0v 08510-028 figure 41. zero-crossing timeout detection phase sequence detection theADE7878 has an on-chip phase sequence error detection circuit. this detection works on phase voltages and considers only the zero crossings determined by their negative to positive transitions. the regular succession of these zero-crossing events is phase a followed by phase b followed by phase c (see figure 43 ). if the sequence of zero-crossing events is, instead, phase a followed by phase c followed by phase b, then bit 19 (seqerr) in the status1[31:0] register is set. if bit 19 (seqerr) in the mask1[31:0] register is set to 1 and a phase sequence error event is triggered, the irq1 interrupt pin is driven low. the status bit is cleared and the irq1 pin is set high by writing to the status1 register with the status bit 19 (seqerr) set to 1. the phase sequence error detection circuit is functional only when the ADE7878 is connected in a 3-phase, 4-wire, three voltage sensors configuration (bits[5:4], consel in accmode[7:0], set to 00). in all other configurations, only two voltage sensors are
ADE7878 rev. 0 | page 31 of 92 used; therefore, it is not recommended to use the detection circuit. in these cases, use the time intervals between phase voltages to analyze the phase sequence (see the time interval between phases section for details). figure 42 presents the case in which phase a voltage is not followed by phase b voltage but by phase c voltage. every time a negative-to-positive zero crossing occurs, bit 19 (seqerr) in the status1[31:0] register is set to 1 because such zero crossings on phase c, phase b, or phase a cannot come after zero crossings from phase a, phase c, or respectively, phase b zero crossings. zx b zx c phase c phase b phase a a, b, c phase voltages after lpf1 bit 19 (seqerr) in status1[31:0] irq1 zx a status1[19] set to 1 status1[19] cancelled by a write to status1[31:0] with seqerr bit set 08510-029 figure 42. seqerr bit set to 1 when phase a voltage is followed by phase c voltage once a phase sequence error has been detected, the time measurement between various phase voltages (see the time interval between phases section) may help to identify which phase voltage should be considered with another phase current in the computational datapath. bits[9:8] (vtoia[1:0]), bits[11:10] (vtoib[1:0]), and bits[13:12] (vtoic[1:0]) in the config[15:0] register can be used to direct one phase voltage to the datapath of another phase. see the changing phase volt age d at ap at h section for details. time interval between phases the ADE7878 has the capability to measure the time delay between phase voltages, between phase currents, or between voltages and currents of the same phase. the negative-to-positive transitions identified by the zero-crossing detection circuit are used as start and stop measuring points. only one set of such measurements is available at one time, based on bits[10:9] (anglesel[1:0]) in the compmode[15:0] register. zx c zx b phase b phase c phase a zx a 0 8510-030 figure 43. phase sequence detection when the anglesel[1:0] bits are set to 00, the default value, the delays between voltages and currents on the same phase are measured. the delay between phase a voltage and phase a current is stored in the 16-bit unsigned angle0[15:0] register (see figure 44 for details). in a similar way, the delays between voltages and currents on phase b and phase c are stored in the angle1[15:0] and angle2[15:0] registers, respectively. phase a current angle0 phase a voltage 08510-031 figure 44. delay between phase a voltage and phase a current is stored in angle0[15:0] when the anglesel[1:0] bits are set to 01, the delays between phase voltages are measured. the delay between phase a voltage and phase c voltage is stored into angle0[15:0]. the delay between phase b voltage and phase c voltage is stored in the angle1[15:0] register, and the delay between phase a voltage and phase b voltage is stored in the angle2[15:0] register (see figure 45 for details). when the anglesel[1:0] bits are set to 10, the delays between phase currents are measured. similar to delays between phase voltages, the delay between phase a and phase c currents is stored into the angle0[15:0] register, the delay between phase b and phase c currents is stored in the angle1[15:0] register, and the delay between phase a and phase b currents is stored into the angle2[15:0] register (see figure 45 for details). phase b phase c phase a angle2 angle0 angle1 0 8510-032 figure 45. delays between ph ase voltages (currents)
ADE7878 rev. 0 | page 32 of 92 the angle0, angle1, and angle2 registers are 16-bit unsigned registers with 1 lsb corresponding to 3.90625 s (256 khz clock), which means a resolution of 0.0703 (360 50 hz/256 khz) for 50 hz systems and 0.0843 (360 60 hz/256 khz) for 60 hz systems. the delays between phase voltages or phase currents are used to characterize how balanced the load is. the delays between phase voltages and currents are used to compute the power factor on each phase as shown in the following equation 5: cos x = cos ? ? ? ? ? ? ? ? khz256 360 line f anglex o (5) where x = a, b, or c and f line is 50 hz or 60 hz. period measurement the ADE7878 provides the period measurement of the line in the voltage channel. bits[1:0] (persel[1:0]) in the mmode[7:0] register select the phase voltage used for this measurement. the period register is a 16-bit unsigned register and is updated every line period. because of the lpf1 filter (see figure 40 ), a settling time of 30 ms to 40 ms is associated with this filter before the measurement is stable. the period measurement has a resolution of 3.90625 s/lsb (256 khz clock), which represents 0.0195% (50 hz/256 khz) when the line frequency is 50 hz and 0.0234% (60 hz/256 khz) when the line frequency is 60 hz. the value of the period register for 50 hz networks is approximately 5120 (256 khz/50 hz) and for 60 hz networks is approximately 4267 (256 khz/60 hz). the length of the register enables the measurement of line frequencies as low as 3.9 hz (256 khz/2 16 ). the period register is stable at 1 lsb when the line is established and the measurement does not change. the following expressions can be used to compute the line period and frequency using the period[15:0] register: [] sec 3256 ]0:15[ e perio d t l = (6) ]hz[ ]0:15[ 3256 period e f l = (7) phase voltage sag detection the ADE7878 can be programmed to detect when the absolute value of any phase voltage drops below a certain peak value for a number of half-line cycles. the phase where this event took place is identified in bits[14:12] (vsphase[2:0]) of the phstatus[15:0] register. this condition is illustrated in figure 46 . phase a voltage bit 16 (sag) in status1[31:0] vsphase[0] = phstatus[12] irq1 pin full scale saglvl[23:0] full scale saglvl[23:0] sagcyc[7:0] = 0x4 phase b voltage vsphase[1] = phstatus[13] status[16] and phstatus[13] set to 1 08510-033 status1[16] and phstatus[12] cancelled by a write to status1[31:0] with sag bit set sagcyc[7:0] = 0x4 figure 46. sag detection figure 46 shows phase a voltage falling below a threshold that is set in the sag level register (saglvl[23:0]) for four half-line cycles (sagcyc = 4). when bit 16 (sag) in the status1[31:0] register is set to 1 to indicate the condition, bit vsphase[0] in the phstatus[15:0] register is also set to 1 because the event happened on phase a. bit 16 (sag) in the status1[31:0] reg- ister, and all bits[14:12] (vsphase[2:0]) of the phstatus[15:0] register (not just the vsphase[0] bit), are erased by writing the status1[31:0] register with the sag bit set to 1. the sagcyc[7:0] register represents the number of half-line cycles the phase voltage must remain below the level indicated in the saglvl register to trigger a sag condition; 0 is not a valid number for sagcyc. for example, when the sag cycle (sagcyc[7:0]) contains 0x07, the sag flag in the status1[31:0] register is set at the end of the seventh half-line cycle for which the line voltage falls below the threshold. if bit 16 (sag) in mask1[31:0] is set, the irq1 interrupt pin is driven low in case of a sag event in the same moment the status bit 16 (sag) in status1[31:0] register is set to 1. the sag status bit in the status1[31:0] register and all bits[14:12] (vsphase[2:0]) of the phstatus[15:0] register are cleared, and the irq1 pin is returned to high by writing to the status1[31:0] register with the status bit set to 1.
ADE7878 rev. 0 | page 33 of 92 when the phase b voltage falls below the indicated threshold into the saglvl[23:0] register for two line cycles, bit vsphase[1] in the phstatus[15:0] register is set to 1, and bit vsphase[0] is cleared to 0. simultaneously, bit 16 (sag) in the status1[31:0] register is set to 1 to indicate the condition. note that the internal zero-crossing counter is always active. by setting the saglvl[23:0] register, the first sag detection result is, therefore, not executed across a full sagcyc period. writing to the sagcyc[7:0] register when the saglvl[23:0] is already initialized resets th e zero-crossing counter, thus ensuring that the first sag detect ion result is obtained across a full sagcyc period. th e recommended procedure to manage sag events is the following: 1. enable sag interrupts in the mask1[31:0] register by setting bit 16 (sag) to 1. 2. when a sag event happens, the irq1 interrupt pin goes low and bit 16 (sag) in the status1[31:0] is set to 1. 3. the status1[31:0] register is read with bit 16 (sag) set to 1. 4. phstatus[15:0] is read, identifying on which phase or phases a sag event happened. 5. the status1[31:0] register is written with bit 16 (sag) set to 1. immediately, the sag bit and all bits[14:12] (vsphase[2:0]) of the phstatus[15:0] register are erased. sag level set the content of the saglvl[23:0] sag level register is compared to the absolute value of the output from hpf. writing 5,928,256 (0x5a7540) to the saglvl register, puts the sag detection level at full scale (see the volt age c hannel ad c section), thus; the sag event is triggered continuously. writing 0x00 or 0x01 puts the sag detection level at 0, therefore, the sag event is never triggered. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. similar to the register presented in figure 33 , the saglvl register is accessed as a 32-bit register with eight msbs padded with 0s. peak detection the ADE7878 records the maximum absolute values reached by the voltage and current channels over a certain number of half- line cycles and stores them into the less significant 24 bits of the vpeak[31:0] and ipeak[31: 0] 32-bit registers. the peakcyc[7:0] register contains the number of half-line cycles used as a time base for the measurement. the circuit uses the zero-crossing points identified by the zero-crossing detection circuit. bits[4:2] (peaksel[2:0]) in the mmode[7:0] register select the phases upon which the peak measurement is performed. bit 2 selects phase a, bit 3 selects phase b, and bit 4 selects phase c. selecting more than one phase to monitor the peak values decreases proportionally the measurement period indi- cated in the peakcyc[7:0] register because zero crossings from more phases are involved in the process. when a new peak value is determined, one of bits[26:24] (ipphase[2:0] or vpphase[2:0]) in the ipeak[31:0] and vpeak[31:0] registers is set to 1, identifying the phase that triggered the peak detection event. for example, if a peak value has been identified on phase a current, bit 24 (ipphase[0]) in the ipeak[31:0] register is set to 1. if next time a new peak value is measured on phase b, then bit 24 (ipphase[0]) of the ipeak[31:0] register is cleared to 0, and bit 25 (ipphase[1]) of the ipeak[31:0] register is set to 1. figure 47 shows the composition of the ipeak and vpeak registers. peak detected on phase c 00000 31 27 26 25 24 23 0 24 bit unsigned number peak detected on phase a ipphase/vpphase bits peak detected on phase b 0 8510-034 figure 47. composition of ipeak[31:0] and vpeak[31:0] registers phase a current phase b current bit 24 of ipeak bit 25 of ipeak peak value written into ipeak at the end of first peakcyc period end of first peakcyc = 16 period bit 24 of ipeak cleared to 0 at the end of second peakcyc period bit 25 of ipeak set to 1 at the end of second peakcyc period end of second peakcyc = 16 period peak value written into ipeak at the end of second peakcyc period 08510-035 figure 48. peak level detection figure 48 shows how the ADE7878 records the peak value on the current channel when measurements on phase a and phase b are enabled (bit peaksel[2:0] in mmode[7:0] are 011). peakcyc[7:0] is set to 16, meaning that the peak measure- ment cycle is four line periods. the maximum absolute value of phase a is the greatest during the first four line periods (peakcyc = 16); therefore, the maximum absolute value is written into the less significant 24 bits of the ipeak[31:0]
ADE7878 rev. 0 | page 34 of 92 register, and bit 24 (ipphase[0]) of the ipeak[31:0] register is set to 1 at the end of the period. this bit remains at 1 for the duration of the second peakcyc period of four line cycles. the maximum absolute value of phase b is the greatest during the second peakcyc period; therefore, the maximum absolute value is written into the less significant 24 bits of the ipeak register, and bit 25 (ipphase[1]) in the ipeak register is set to 1 at the end of the period. at the end of the peak detection period in the current channel, bit 23 (pki) in the status1[31:0] register is set to 1. if bit 23 (pki) in the mask1[31:0] register is set, then the irq1 interrupt pin is driven low at the end of the peakcyc period, and status bit 23 (pki) in the status1[31:0] register is set to 1. in a similar way, at the end of the peak detection period in the voltage channel, bit 24 (pkv) in the status1[31:0] register is set to 1. if bit 24 (pkv) in the mask1[31:0] register is set, then the irq1 interrupt pin is driven low at the end of the peakcyc period and status bit 24 (pkv) in the status1[31:0] is set to 1. to find the phase that triggered the interrupt, one of either the ipeak[31:0] or vpeak[31:0] registers is read immediately after reading the status1[31:0] register. then the status bits are cleared and the irq1 pin is set to high by writing to the status1[31:0] register with the status bit set to 1. note that the internal zero-crossing counter is always active. by setting bits [4:2] (peaksel[2:0]) in the mmode[7:0] register, the first peak detection result is not executed across a full peakcyc period. writing to the peakcyc[7:0] register when the peaksel[2:0] bits are set resets the zero-crossing counter, thereby ensuring that the first peak detection result is obtained across a full peakcyc period. overvoltage and overcurrent detection the ADE7878 detects when the instantaneous absolute value measured on the voltage and current channels becomes greater than the thresholds set in the ovlvl[23:0] and oilvl[23:0] 24-bit unsigned registers. if bit 18 (ov) in the mask1[31:0] register is set, the irq1 interrupt pin is driven low in case of an overvoltage event. there are two status flags set when the irq1 interrupt pin is driven low: bit 18 (ov) in the status1[31:0] register and one of bits[11:9] (ovphase[2:0]) in the phstatus[15:0] register to identify the phase that generated the overvoltage. the status bit 18 (ov) in the status1[31:0] register and all bits[11:9] (ovphase[2:0]) in the phstatus[15:0] register are cleared and the irq1 pin is set to high by writing to the status1[31:0] register with the status bit set to 1. presents overvoltage detection in phase a voltage. figure 49 ovlvl[23:0] bit 18 (ov) of status1 bit 9 (ovphase) of phstatus phase a voltage channel overvoltage detected status1[18] and phstatus[9] cancelled by a write of status1 with ov bit set. 0 8510-036 figure 49. overvoltage detection whenever the absolute instantaneous value of the voltage goes above the threshold from the ovlvl[23:0] register, bit 18 (ov) in the status1[31:0] register and bit 9 (ovphase[0]) in the phstatus[15:0] register are set to 1. bit 18 (ov) of the status1[31:0] register and bit 9 (ovphase[0]) in the phstatus[15:0] register are cancelled when the status1 register is written with bit 18 (ov) set to 1. th e recommended procedure to manage overvoltage events is the following: 1. enable ov interrupts in the mask1[31:0] register by setting bit 18 (ov) to 1. 2. when an overvoltage event happens, the irq1 interrupt pin goes low. 3. the status1[31:0] register is read with bit 18 (ov) set to 1. 4. the phstatus[15:0] register is read, identifying on which phase or phases an overvoltage event happened. 5. the status1[31:0] register is written with bit 18 (ov) set to 1. in this moment, bit ov is erased as are all bits[11:9] (ovphase[2:0]) of the phstatus[15:0] register. in case of an overcurrent event, if bit 17 (oi) in the mask1[31:0] register is set, the irq1 interrupt pin is driven low. immediately, bit 17 (oi) in the status1[31:0] register and one of bits[5:3] (oiphase[2:0]) in the phstatus[15:0] register, which identify the phase that generated the interrupt, are set. to find the phase that triggered the interrupt, the phstatus[15:0] register is read immediately after reading the status1[31:0] register. then, the status bit 17 (oi) in the status1[31:0] register and bits[5:3] (oiphase[2:0]) in the phstatus[15:0] register are cleared and the irq1 pin is set to high by writing to the status1[31:0] register with the status bit set to 1. the process is similar with overvoltage detection.
ADE7878 rev. 0 | page 35 of 92 overvoltage and overcurrent level set the content of the overvoltage, ovlvl[23:0], and overcurrent, oilvl[23:0], 24-bit unsigned registers is compared to the abso- lute value of the voltage and current channels. the maximum value of these registers is the maximum value of the hpf outputs: +5,928,256 (0x5a7540). when ovlvl or oilvl is equal to this value, the overvoltage or overcurrent conditions are never detected. writing 0x0 to these registers signifies the overvoltage or overcurrent conditions are continuously detected and the corresponding interrupts are triggered permanently. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. similar to the register presented in figure 33, the oilvl and ovlvl registers are accessed as 32-bit registers with the eight msbs padded with 0s. neutral current mismatch in 3-phase systems, the neutral current is equal to the algebraic sum of the phase currents: i n (t) = i a (t) + i b (t) + i c (t). if there is a mismatch between these two quantities, then a tamper situation may have occurred in the system. the ADE7878 computes the sum of the phase currents, adding the content of the iawv[23:0], ibwv[23:0], and icwv[23:0] registers and storing the result into the isum[27:0] 28-bit signed register: i sum (t) = i a (t) + i b (t) + i c (t). isum is computed every 125 s (8 khz frequency), the rate at which the current samples are available. bit 17 (dready) in the status0[31:0] register can be used to signal when the isum register may be read. see the digital signal processor section for more details on bit dready. to re c ove r t he i sum (t) value from the isum[27:0] register, use the following expression: fs max sum i adc isum ti = ]0:27[ ) ( where: adc max = 5,928,256, the adc output when the input is at full scale. i fs = the full-scale adc phase current. the ADE7878 computes the difference between the absolute values of isum and the neutral current from the inwv[23:0] register, takes its absolute value, and compares it against isumlvl threshold. if isumlvl inwv isum ? , then it is assumed that the neutral current is equal to the sum of the phase currents and the system functions correctly. if isumlvl inwv isum >? , then a tamper situation may have occurred, and bit 20 (mismtch) in the status1[31:0] register is set to 1. an interrupt attached to the flag may be enabled by setting bit 20 (mismtch) in the mask1[31:0] register. if enabled, the irq1 pin is set low when status bit mismtch is set to 1. the status bit is cleared and the irq1 pin is set back high by writing the status1 register with bit 20 (mismtch) set to 1. if isumlvl inwv isum ? , then mismtch = 0 if isumlvl inwv isum >? , then mismtch = 1 isumlvl[23:0], the positive threshold used in the process, is a 24-bit signed register. because it is used in a comparison with an absolute value, it should always be set as a positive number, somewhere between 0x00000 and 0x7fffff. isumlvl uses the same scale of the current adcs outputs, so writing +5,928,256 (0x5a7540) to the isumlvl register puts the mismatch detection level at full scale; see the current channel adc section for details. writing 0x000000, the default value, or a negative value, signifies that the mismtch event is always triggered. the right value for the application should be written into the isumlvl[23:0] register after power-up or after a hardware/software reset to avoid continuously triggering mismtch events. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words, and the dsp works on 28 bits. as presented in figure 50, isum[27:0], the 28-bit signed register is accessed as a 32-bit register with the four most significant bits padded with 0s. 31 28 27 bit 27 is a sign bit 0 28-bit signed number 0000 08510-250 figure 50. isum[27:0] register is transmitted as a 32-bit word similar to the registers presented in figure 32, the isumlvl[23:0] register is accessed as a 32-bit register with the four most significant bits padded with 0s and sign extended to 28 bits. phase compensation as described in the current channel adc and voltage channel adc sections, the datapath for both current and voltages is the same. the phase error between current and voltage signals introduced by the ADE7878 is negligible. however, the ADE7878 must work with transducers that may have inherent phase errors. for example, a current transformer (ct) with a phase error of 0.1 to 3 is not uncommon. these phase errors can vary from part to part, and they must be corrected to perform accurate power calculations. the errors associated with phase mismatch are particularly noticeable at low power factors. theADE7878 provides a means of digitally calibrating these small phase errors. the ADE7878 allows a small time delay or time advance to be introduced into the signal processing chain to compensate for the small phase errors. the phase calibration registers (aphcal[9:0], bphcal[9:0], and cphcal[9:0]) are 10-bit registers that can vary the time
ADE7878 rev. 0 | page 36 of 92 advance in the voltage channel signal path from +61.5 s to ?374.0 s, respectively. negative values written to the phcal registers represent a time advance whereas positive values represent a time delay. one lsb is equivalent to 0.976 s of time delay or time advance (clock rate of 1.024 mhz). with a line frequency of 60 hz, this gives a phase resolution of 0.0211 (360 60 hz/1.024 mhz) at the fundamental. this corresponds to a total correction range of ?8.079 to +1.329 at 60 hz. at 50 hz, the correction range is ?6.732 to +1.107 and the resolution is 0.0176 (360 50 hz/1.024 mhz). given a phase error of x degrees measured using the phase voltage as the reference, the corresponding lsbs are computed dividing x by the phase resolution (0.0211/lsb for 60 hz and 0.0176/lsb for 50 hz). results between ?383 and +63 only are acceptable; numbers outside this range are not acceptable. if the result is negative, the absolute value is written into the phcal registers. if the result is positive, 512 is added to the result before writing it into xphcal. aphcal, bphcal , or cphcal = ? ? ? ? ? ? ? ? ? ? ? ? ? ? >+ 0,512 _ 0, _ x resolution phase x x resolution phase x (8) figure 52 illustrates how the phase compensation is used to remove x = ?1 phase lead in ia of the current channel from the external current transducer (equivalent of 55.5 s for 50 hz systems). to cancel the lead (1) in the current channel of phase a, a phase lead must be introduced into the corres- ponding voltage channel. using equation 8, aphcal is 57, rounded up from 56.8. the phase lead is achieved by introducing a time delay of 55.73 s into the phase a current. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. as shown in figure 51 , the aphcal, bphcal, and cphcal 10-bit registers are accessed as 16-bit registers with the six msbs padded with 0s. 0000 00 15 10 9 0 xphcal 08510-038 figure 51. xphcal registers communicated as 16-bit registers phase calibration aphcal = 57 adc pga3 vap va vn adc pga1 i a p ia ian phase compensation achieved delaying ia by 56s 50hz 1 va ia va ia 08510-039 figure 52. phase calibration on voltage channels
ADE7878 rev. 0 | page 37 of 92 reference circuit the nominal reference voltage at the ref in/out pin is 1.2 0.075% v. this is the reference voltage used for the adcs in the ADE7878. the ref in/out pin can be overdriven by an external source, for example, an external 1.2 v reference. the voltage of the ADE7878 reference drifts slightly with temperature; see the specifications section for the temperature coefficient specification (in ppm/c). the value of the temperature drift varies from part to part. because the reference is used for all adcs, any x% drift in the reference results in a 2x% deviation of the meter accuracy. the reference drift resulting from temperature changes is usually very small and typically much smaller than the drift of other components on a meter. alternatively, the meter can be calibrated at multiple temperatures. if bit 0 (extrefen) in the config2[7:0] register is cleared to 0 (the default value), the ADE7878 uses the internal voltage refer- ence. if the bit is set to 1, then the external voltage reference is used. set the config2 register during the psm0 mode. its value is maintained during the psm1, psm2, and psm3 power modes. digital signal processor the ADE7878 contains a fixed function digital signal processor (dsp) that computes all powers and rms values. it contains various memories: program memory rom, program memory ram, and data memory ram. the program used for the power and rms computations is stored in the program memory rom, and the processor executes it every 8 khz. the end of the computations is signaled by setting bit 17 (dready) to 1 in the status0[31:0] register. an interrupt attached to this flag can be enabled by setting bit 17 (dready) in the mask0[31:0] register. if enabled, the irq0 pin is set low and status bit dready is set to 1 at the end of the computations. the status bit is cleared and the irq0 pin is set to high by writing to the status0[31:0] register with bit 17 (dready) set to 1. the registers used by the dsp are located in the data memory ram at addresses between 0x4000 and 0x43ff. the width of this memory is 28 bits. as seen in the power-up procedure section, at power-up or after a hardware or software reset, the dsp is in idle mode. no instruction is executed. all the registers located in the data memory ram are initialized at 0, their default values. the register run[15:0] that is used to start and stop the dsp is cleared to 0x0000. the run[15:0] register must be written with 0x0001 for the dsp to start code execution. it is recommended to first initialize all ADE7878 registers located in the data memory ram with their desired values and then write the run[15:0] register with 0x0001. in this way, the dsp starts the computations from a desired configuration. th ere is no obvious reason to stop the dsp if the ADE7878 is maintained in psm0 normal mode. all ADE7878 registers, including ones located in the data memory ram, can be modified without stopping the dsp. however, to stop the dsp, 0x0000 must be written into register run[15:0]. to start the dsp again, one of the following procedures must be followed: ? i f the ADE7878 registers located in the data memory ram have not been modified, write 0x0001 into register run[15:0] to start the dsp. ? if the ADE7878 registers located in the data memory ram have to be modified, first execute a software or a hardware reset, initialize all ADE7878 registers at desired values, and then write 0x0001 into register run[15:0] to start the dsp. as mentioned in the power management section, when the ADE7878 switches out of psm0 power mode, it is recommended to stop the dsp by writing 0x0000 into the run[15:0] register (see table 10 and tabl e 11 for the recommended actions when changing power modes). root mean square measurement root mean square (rms) is a measurement of the magnitude of an ac signal. its definition can be both practical and mathematical. defined practically, the rms value assigned to an ac signal is the amount of dc required to produce an equivalent amount of power in the load. mathematically, the rms value of a continuous signal f(t) is defined as () dttf t frms = t 0 2 1 (9) for time sampling signals, rms calculation involves squaring the signal, taking the average, and obtaining the square root. [] = = n n nf n frms 1 2 1 (10) equation 10 implies that for signals containing harmonics, the rms calculation contains the contribution of all harmonics, not only the fundamental. the ADE7878 uses two different methods to calculate rms values. the first one is very accurate and is active only in psm0 mode. the second one is less accurate, uses the estimation of the mean absolute value (mav) measurement, and is active in psm0 and psm1 modes. the first method is to low-pass filter the square of the input signal (lpf) and take the square root of the result (see figure 53 ). ( k k k tkftf + = = sin2)( 1 ) (11) then () () ? = = = ++ + ++ ?= mk mk m k m k k k k k k tmtkff tkfftf 1, 1 2 1 2 2 sin sin 22 )2cos( )( (12)
ADE7878 rev. 0 | page 38 of 92 after the lpf and the execution of the square root, the rms value of f(t) is obtained by = = 1 2 k k ff (13) the rms calculation based on this method is simultaneously processed on all seven analog input channels. each result is available in the 24-bit registers: airms, birms, cirms, avrms, bvrms, cvrms, and nirms. the other method computes the absolute value of the input signal and then filters it to extract its dc component. it basically computes the absolute mean value of the input. if the input signal in equation 12 has only fundamental component, its average value is ? ? ? ? ? ? ? ? ? ? ?= t t 1 t 1 dc dttfdttf t f 2 2 0 )sin(2)sin(2 1 1 dc f f = 2 2 the calculation based on this method is simultaneously processed only on the three phase currents. each result is available in the 20-bit registers: aimav, bmav, and cmav. note that the proportionality between mav and rms values is maintained only for the fundamental components. if harmonics are present in the current channel, then the mean absolute value is not anymore proportional to rms. current rms calculation this section presents the first approach to compute the rms values of all phase and neutral currents. figure 53 shows the detail of the signal processing chain for the rms calculation on one of the phases of the current channel. the current channel rms value is processed from the samples used in the current channel. the current rms values are signed 24-bit values, and they are stored into the airms[23:0], birms[23:0], cirms[23:0], and nirms[23:0] registers. the update rate of the current rms measurement is 8 khz. with the specified full-scale analog input signal of 0.5 v, the adc produces an output code that is approximately 5,928,256. the equivalent rms value of a full-scale sinusoidal signal is 4,191,910 (0x3ff6a6), independent of the line frequency. if the integrator is enabled, that is, when bit 0 (inten) in the config[15:0] register is set to 1, the equivalent rms value of a full-scale sinusoidal signal at 50 hz is 4,191,910 (0x3ff6a6) and at 60 hz is 3,493,258 (0x354d8a). the accuracy of the current rms is typically 0.1% error from the full-scale input down to 1/1000 of the full-scale input when pga = 1. additionally, this measurement has a bandwidth of 2 khz. it is recommended to read the rms registers synchronous to the voltage zero crossings to ensure stability. the irq1 inter- rupt can be used to indicate when a zero crossing has occurred (see the section). shows the settling time for the i rms measurement, which is the time it takes for the rms register to reflect the value at the input to the current channel when starting from 0. interrupts table 12 table 12. settling time for i rms measurement integrator status 50 hz input signals 60 hz inputsignals integrator off 440 ms 440 ms integrator on 550 ms 500 ms as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. similar to the register presented in figure 33 , the airms, birms, cirms, and nirms 24-bit signed registers are accessed as 32-bit registers with the eight msbs padded with 0s. 0xa58ac0 = ?5,928,256 0x5a7540 = 5,928,256 0v current signal from hpf or integrator (if enabled) lpf x 2 2 7 xirmsos[23:0] xirms[23:0] 08510-040 figure 53. current rms signal processing
ADE7878 rev. 0 | page 39 of 92 current rms offset compensation the ADE7878 incorporates a current rms offset compensation register for each phase: airmsos[23:0], birmsos[23:0], cirmsos[23:0], and nirmsos[23:0]. these are 24-bit signed registers and are used to remove offsets in the current rms calculations. an offset can exist in the rms calculation due to input noises that are integrated in the dc component of i 2 (t). one lsb of the current rms offset compensation register is equivalent to one lsb of the current rms register. assuming that the maximum value from the current rms calculation is 4,191,400 with full-scale ac inputs (50 hz), one lsb of the current rms offset represents 0.00037% ( ( ) 10014191/1284191 2 ? + ) of the rms measurement at 60 db down from full scale. conduct offset calibration at low current; avoid using currents equal to zero for this purpose. irmsos irms irms += 128 2 0 (14) where irms 0 is the rms measurement without offset correction. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words, and the dsp works on 28 bits. similar to the register presented in figure 32 , the airmsos, birmsos, cirmsos, and nirmsos 24-bit signed registers are accessed as 32-bit registers with four msbs padded with 0s and sign extended to 28 bits. current mean absolute value calculation this section presents the second approach to estimate the rms values of all phase currents using the mean absolute value (mav) method. this approach is used in psm1 mode to allow energy accumulation based on current rms values when the missing neutral case demonstrates to be a tamper attack. this datapath is active also in psm0 mode to allow for its gain calibration. the gain is used in the external microprocessor during psm1 mode. the mav value of the neutral current is not computed using this method. current signal coming from adc ximav[23:0] hpf hpf |x| 08510-251 figure 54. current mav signal processing for psm1 mode figure 54 shows the details of the signal processing chain for the mav calculation on one of the phases of the current channel. the current channel mav value is processed from the samples used in the current channel waveform sampling mode. the samples are passed through a high-pass filter to eliminate the eventual dc offsets introduced by the adcs, and the absolute values are computed. the outputs of this block are then filtered to obtain the average. the current mav values are unsigned 20-bit values and they are stored in the aimav[19:0], bimav[19:0], and cimav[19:0] registers. the update rate of this mav measure- ment is 8 khz. 207000 207500 208000 208500 209000 209500 210000 210500 211000 211500 212000 45 50 55 frequency (hz) lsbs 60 65 08510-252 figure 55. ximav[19:0] values at full scale, 45 hz to 65 hz line frequencies the mav values of full-scale sinusoidal signals of 50 hz and 60 hz are 209,686 and 210,921, respectively. as seen in figure 55 , there is a 1.25% variation between the mav estimate at 45 hz and the one at 65 hz for full-scale sinusoidal inputs. the accuracy of the current mav is typically 0.5% error from the full-scale input down to 1/100 of the full-scale input. additionally, this measurement has a bandwidth of 2 khz. the settling time for the imav measurement, that is, the time it takes for the mav register to reflect the value at the input to the current channel within 0.5% error, is 500 ms. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. as presented in figure 56 , the aimav, bimav, and cimav 20-bit unsigned registers are accessed as 32-bit registers with the 12 msbs padded with 0s. 31 20 19 0 20-bit unsigned number 0000 0000 0000 08510-253 figure 56. ximav registers transmitted as 32-bit registers current mav gain and offset compensation the current rms values stored in aimav, bimav, and cimav can be calibrated using gain and offset coefficients corresponding to each phase. it is recommended to calculate the gains in psm0 mode by supplying the ADE7878 with nominal currents. the offsets can be estimated by supplying the ADE7878 with low currents, usually equal to the minimum value at which the accuracy is required. every time the external microcontroller reads the aimav, bimav, and cimav registers, it uses these coefficients stored in its memory to correct them.
ADE7878 rev. 0 | page 40 of 92 voltage channel rms calculation figure 57 shows the detail of the signal processing chain for the rms calculation on one of the phases of the voltage channel. the voltage channel rms value is processed from the samples used in the voltage channel. the voltage rms values are signed 24-bit values, and they are stored into the avrms[23:0], bvrms[23:0], and cvrms[23:0] registers. the update rate of the current rms measurement is 8 khz. with the specified full-scale analog input signal of 0.5 v, the adc produces an output code that is approximately 5,928,256. the equivalent rms value of a full-scale sinusoidal signal is 4,191,910 (0x3ff6a6), independent of the line frequency. the accuracy of the voltage rms is typically 0.1% error from the full-scale input down to 1/1000 of the full-scale input. additionally, this measurement has a bandwidth of 2 khz. it is recommended to read the rms registers synchronous to the voltage zero crossings to ensure stability. the irq1 interrupt can be used to indicate when a zero crossing has occurred (see the section). interrupts the settling time for the v rms measurement is 440 ms for both 50 hz and 60 hz input signals. the v rms measurement is the time it takes for the rms register to reflect the value at the input to the voltage channel when starting from 0. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. similar to the register presented in figure 33 , the avrms, bvrms, and cvrms 24-bit signed registers are accessed as 32-bit registers with the eight msbs padded with 0s. 0xa58ac0 = ?5,928,256 0x5a7540 = 5,928,256 0v voltage signal from hpf lpf x 2 2 7 xvrmsos[23:0] xvrms[23:0] 08510-041 figure 57. voltage rms signal processing
ADE7878 rev. 0 | page 41 of 92 voltage rms offset compensation the ADE7878 incorporates voltage rms offset compensation registers for each phase: avrmsos[23:0], bvrmsos[23:0], and cvrmsos[23:0]. these are 24-bit signed registers used to remove offsets in the voltage rms calculations. an offset can exist in the rms calculation due to input noises that are integrated in the dc component of v 2 (t). one lsb of the voltage rms offset compensation register is equivalent to one lsb of the voltage rms register. assuming that the maximum value from the voltage rms calculation is 4,191,400 with full-scale ac inputs (50 hz), one lsb of the current rms offset represents 0.00037% ( ( ) )10014191/1284191 2 ? + of the rms measurement at 60 db down from full scale. conduct offset calibration at low current; avoid using voltages equal to zero for this purpose. vrmsos vrms vrms += 128 2 0 (15) where v rms 0 is the rms measurement without offset correction. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words, and the dsp works on 28 bits. similar to registers presented in figure 32 , the avrmsos, bvrmsos, and cvrmsos 24-bit registers are accessed as 32-bit registers with the four most significant bits padded with 0s and sign extended to 28 bits. active power calculation the ADE7878 computes the total active power on every phase. total active power considers in its calculation all fundamental and harmonic components of the voltages and currents. the ADE7878 also computes the fundamental active power, the power determined only by the fundamental components of the voltages and currents. total active power calculation electrical power is defined as the rate of energy flow from source to load. it is given by the product of the voltage and current waveforms. the resulting waveform is called the instantaneous power signal, and it is equal to the rate of energy flow at every instant of time. the unit of power is the watt or joules/sec. if an ac system is supplied by a voltage, v(t), and consumes the current, i(t), and each of them contains harmonics, then sin2)( 1 = = k k vtv ( kt + k ) (16) () k k k tkiti + = = sin2)( 1 where: v k , i k = rms voltage and current of each harmonic. k , k are the phase delays of each harmonic. the instantaneous power in an ac system is p ( t ) = v ( t) i ( t ) = cos( k C k ) ? cos(2 kt + k C k ) + {cos[( k ? m ) t + k C m ] C cos[( k + m ) t + k + m ]} = 1 k kk iv = 1 k kk iv = mk mk m k iv 1, (17) the average power over an integral number of line cycles (n) is given by the expression in equation 18. p = () = = 1 0 1 k kk nt ivdttp nt cos( k C k ) (18) where: t is the line cycle period. p is referred to as the total active or total real power. note that the total active power is equal to the dc component of the instantaneous power signal p (t ) in equation 17, that is, cos( k C k ). this is the expression used to calculate the total active power in the ADE7878 for each phase. the expression of fundamental active power is obtained from equation 18 with k = 1, as follows: = 1 k kk iv fp = v 1 i 1 cos( 1 C 1 ) (19) figure 58 shows how the ADE7878 computes the total active power on each phase. first, it multiplies the current and voltage signals in each phase. next, it extracts the dc component of the instantaneous power signal in each phase (a, b, and c) using lpf2, the low-pass filter.
ADE7878 rev. 0 | page 42 of 92 avgain hpfdis [23:0] hpf lpf aigain hpfdis [23:0] digital integrator hpf va ia awgain awattos aphcal instantaneous phase a active power 08510-145 digital signal processor figure 58. total active power datapath if the phase currents and voltages contain only the fundamental component, are in phase (that is 1 = 1 = 0) and correspond to full-scale adc inputs, then multiplying them results in an instantaneous power signal that has a dc component, v 1 i 1 , and a sinusoidal component, v 1 i 1 cos(2t). figure 59 shows the corresponding waveforms. instantaneou s power signal instantaneous active power signal: vrms irms p(t)= vrms irms ? vrms irms cos(2 t) 0x3fed4d6 67,032,278 vrms irms 0x1ff6a6b = 33,516,139 0x000 0000 i(t) = 2 irms sin( t) v(t) = 2vrmssin( t) 08510-043 figure 59. active power calculation because lpf2 does not have an ideal brick wall frequency response (see figure 60 ), the active power signal has some ripple due to the instantaneous power signal. this ripple is sinusoidal and has a frequency equal to twice the line frequency. because the ripple is sinusoidal in nature, it is removed when the active power signal is integrated over time to calculate the energy. 0 ?5 ?10 ?15 ?20 ?25 0.1 13 frequency (hz) magnitude (db) 1 0 08510-103 figure 60. frequency response of the lpf used to filter instantaneous power in each phase the ADE7878 stores the instantaneous total phase active powers into the awatt[23:0], bwatt[23:0], and cwatt[23:0] registers. their expression is = = 1 k fs k fs k i i u u xwatt cos( k C k ) pmax 4 2 1 (20) where: u fs , i fs are the rms values of the phase voltage and current when the adc inputs are at full scale. pmax = 33,516,139; it is the instantaneous power computed when the adc inputs are at full scale and in phase. the xwatt[23:0] waveform registers can be accessed using various serial ports. refer to the wavefor m s ampl ing mo de section for more details.
ADE7878 rev. 0 | page 43 of 92 fundamental active power calculation the ADE7878 computes the fundamental active power using a proprietary algorithm that requires some initializations function of the frequency of the network and its nominal voltage measured in the voltage channel. bit 14 (selfreq) in the compmode[15:0] register must be set according to the frequency of the network in which the ADE7878 is connected. if the network frequency is 50 hz, then clear this bit to 0 (the default value). if the network frequency is 60 hz, then set this bit to 1. also, the vlevel[23:0] 24-bit signed register should be initialized with a positive value based on the following expression: 520,491 = n fs u u vlevel (21) where: u fs is the rms value of the phase voltages when the adc inputs are at full scale. u n is the rms nominal value of the phase voltage. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words, and the dsp works on 28 bits. similar to the registers presented in figure 32 , the vlevel[23:0] 24-bit signed register is accessed as a 32-bit register with the four most significant bits padded with 0s and sign extended to 28 bits. table 13 presents the settling time for the fundamental active power measurement. table 13.settling time for fundamental active power input signals 63% full scale 100% full scale 375 ms 875 ms active power gain calibration note that the average active power result from the lpf2 output in each phase can be scaled by 100% by writing to the phases watt gain 24-bit register, (awgain[23:0], bwgain[23:0], cwgain[23:0], afwgain[23:0], bfwgain[23:0], or cfwgain[23:0]). the xwgain registers are placed in each phase of the total active power datapath, and the xfwgain registers are placed in each phase of the fundamental active power datapath. the watt gain registers are twos complement signed registers and have a resolution of 2 ?23 /lsb. equation 22 describes mathematically the function of the watt gain registers. ? ? ? ? ? ? + = 23 2 1 2 gisterregainwatt output lpf datapowe r averag e (22) the output is scaled by ?50% by writing 0xc00000 to the watt gain registers, and it is increased by +50% by writing 0x400000 to them. these registers can be used to calibrate the active power (or energy) calculation in the ADE7878 for each phase. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words, and the dsp works on 28 bits. similar to registers presented in figure 32 , the awgain, bwgain, cwgain, afwgain, bfwgain, and cfwgain 24-bit signed registers are accessed as 32-bit registers with the four msbs padded with 0s and sign extended to 28 bits. active power offset calibration the ADE7878 also incorporates a watt offset 24-bit register on each phase and on each active power. the awattos[23:0], bwattos[23:0], and cwattos[23:0] registers compensate the offsets in the total active power calculations, and the afwattos[23:0], bfwattos[23:0], and cfwattos[23:0] registers compensate offsets in the fundamental active power calculations. these are signed twos complement 24-bit registers that are used to remove offsets in the active power calculations. an offset can exist in the power calculation due to crosstalk between channels on the pcb or in the chip itself. the offset calibration allows the contents of the active power register to be maintained at 0 when no power is being consumed. one lsb in the active power offset register is equivalent to 1 lsb in the active power multiplier output. with full-scale current and voltage inputs, the lpf2 output is pmax = 33,516,139. at ?80 db down from the full scale (active power scaled down 10 4 times), one lsb of the active power offset register represents 0.0298% of pmax. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words, and the dsp works on 28 bits. similar to registers presented in figure 32 , the awattos, bwattos, and cwattos, afwattos, bfwattos, cfwattos 24-bit signed registers are accessed as 32-bit registers with the four msbs padded with 0s and sign extended to 28 bits. sign of active power calculation note that the average active power is a signed calculation. if the phase difference between the current and voltage waveform is more than 90, the average power becomes negative. negative power indicates that energy is being injected back on the grid. the ADE7878 has sign detection circuitry for total active power calculations. it can monitor the total active powers or the funda- mental active powers. as described in the active energy calculation section, the active energy accumulation is performed in two stages. every time a sign change is detected in the energy accumulation at the end of the first stage, that is, after the energy accumulated into the internal accumulator reaches the wthr[47:0] threshold, a dedicated interrupt is triggered. the sign of each phase active power can be read in the phsign[15:0] register. bit 6 (revapsel) in the accmode[7:0] register sets the type of active power being monitored. when revapsel is 0, the default value, the total active power is monitored. when revapsel is 1, the fundamental active power is monitored.
ADE7878 rev. 0 | page 44 of 92 d t denerg y power = (23) bits[8:6] (revapc, revapb, and revapa, respectively) in the status0[31:0] register are set when a sign change occurs in the power selected by bit 6 (revapsel) in the accmode[7:0] register. conversely, energy is given as the integral of power, as follows: () dttpenergy = (24) bits[2:0] (cwsign, bwsign, and awsign, respectively) in the phsign[15:0] register are set simultaneously with the revapc, revapb, and revapa bits. they indicate the sign of the power. when they are 0, the corresponding power is positive. when they are 1, the corresponding power is negative. total and fundamental active energy accumulations are always signed operations. negative energy is subtracted from the active energy contents. the ADE7878 achieves the integration of the active power signal in two stages (see figure 61 ). the process is identical for both total and fundamental active powers. the first stage is accomplished inside the dsp: every 125 s (8 khz frequency), the instantaneous phase total or fundamental active power is accumulated into an internal register. when a threshold is reached, a pulse is generated at the processor port and the threshold is subtracted from the internal register. the sign of the energy in this moment is considered the sign of the active power (see sign of active power calculation section for details). the second stage is done outside the dsp and consists of accumulating the pulses generated by the processor into internal 32-bit accumulation registers. the content of these registers is transferred to the watt-hour registers, xwatthr[31:0] and xfwatthr[31:0], when these registers are accessed. bit revapx of the status0[31:0] register and bit xwsign in the phsign[15:0] register refer to the total active power of phase x, the power type being selected by bit 6 (revapsel) in the accmode[7:0] register. interrupts attached to bits[8:6] (revapc, revapb, and revapa, respectively) in the status0[31:0] register can be enabled by setting bits[8:6] in the mask0[31:0] register. if enabled, the irq0 pin is set low and the status bit is set to 1 whenever a change of sign occurs. to find the phase that triggered the interrupt, the phsign[15:0] register is read immediately after reading the status0[31:0] register. next, the status bit is cleared and the irq0 pin is returned to high by writing to the status0 register with the corresponding bit set to 1. active energy calculation as previously stated, power is defined as the rate of energy flow. this relationship can be expressed mathematically as avgain hpfdis [23:0] hpf aigain hpfdis [23:0] digital integrator revapa bit in status0[31:0] hpf va ia awgain awattos aphcal accumulator wthr[47:0] awatthr[31:0] 32-bit register lpf2 08510-044 digital signal processor figure 61. total active energy accumulation
ADE7878 rev. 0 | page 45 of 92 wthr[47:0] 1 dsp pulse = 1lsb of watthr[47:0] active power a ccumulation in dsp dsp generated pulses 08510-045 figure 62. active power accumulation inside dsp figure 62 explains this process. the wthr[47:0] 48-bit signed register contains the threshold. it is introduced by the user and is common for all phase total active and fundamental powers. its value depends on how much energy is assigned to one lsb of watt-hour registers. supposing a derivative of wh [10 n wh], n as an integer, is desired as one lsb of the xwatthr register. then wthr is computed using the following expression: fsfs n s iu fpmax wthr = 103600 (25) where: pmax = 33,516,139 = 0x1ff6a6b as the instantaneous power computed when the adc inputs are at full scale. f s = 8 khz, the frequency with which the dsp computes the instantaneous power. u fs , i fs are the rms values of phase voltages and currents when the adc inputs are at full scale. the maximum value that can be written on wthr[47:0] is 2 47 ? 1. the minimum value is 0x0, but it is recommended to write a number equal to or greater than pmax. never use negative numbers. the wthr[47:0] is a 48-bit register. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. as shown in figure 63 , the wthr register is accessed as two 32-bit registers (wthr1[31:0] and wthr0[31:0]), each having eight msbs padded with 0s. wthr[47:0] 47 24 31 24 23 0 31 24 23 0 23 0 wthr1[31:0] wthr0[31:0] 0000 0000 24 bit signed number 0000 0000 24 bit signed number 08510-046 figure 63. wthr[47:0] communicated as two 32-bit registers this discrete time accumulation or summation is equivalent to integration in continuous time following the description in equation 26. () () ? ? ? ? ? ? == = 0 0t lim n tntp dttpenergy (26) where: n is the discrete time sample number. t is the sample period. in the ADE7878, the total phase active powers are accumulated in the awatthr[31:0], bwatthr[31:0], and cwatthr[31:0] 32-bit signed registers, and the fundamental phase active powers are accumulated in the afwatthr[31:0], bfwatthr[31:0], and cfwatthr[31:0] 32-bit signed registers. the active energy register content can roll over to full-scale negative (0x80000000) and continue increasing in value when the active power is positive. conversely, if the active power is negative, the energy register underflows to full-scale positive (0x7fffffff) and continues decreasing in value. bit 0 (aehf) in the status0[31:0] register is set when bit 30 of one of the xwatthr registers changes, signifying that one of these registers is half full. if the active power is positive, the watt-hour register becomes half full when it increments from 0x3fff ffff to 0x4000 0000. if the active power is negative, the watt-hour register becomes half full when it decrements from 0xc000 0000 to 0xbfff ffff. similarly, bit 1 (faehf) in vstatus0[31:0] register is set when bit 30 of one of the xfwatthr registers changes, signifying that one of these registers is half full. setting bits[1:0] in the mask0[31:0] register enables the faehf and aehf interrupts, respectively. if enabled, the irq0 pin is set low and the status bit is set to 1 whenever one of the energy registers, xwatthr (for the aehf interrupt) or xfwatthr (for the faehf interrupt), become half full. the status bit is cleared and the irq0 pin is set to logic high by writing to the status0 register with the corresponding bit set to 1. setting bit 6 (rstread) of the lcymode[7:0] register enables a read-with-reset for all watt-hour accumulation registers; that is, the registers are reset to 0 after a read operation. integration time under steady load the discrete time sample period (t) for the accumulation register is 125 s (8 khz frequency). with full-scale sinusoidal signals on the analog inputs and the watt gain registers set to 0x00000, the average word value from each lpf2 is pmax = 33,516,139 = 0x1ff6a6b. if the wthr[47:0] threshold is set at the pmax level, this means that the dsp generates a pulse that is added to the watt-hour registers every 125 s. the maximum value that can be stored in the watt-hour accumulation register before it overflows is 2 31 ? 1 or 0x7fffffff. the integration time is calculated as time = 0x7fff,ffff 125 s = 74 hr 33 min 55 sec (27)
ADE7878 rev. 0 | page 46 of 92 energy accumulation modes the active power accumulated in each watt-hour accumulation 32-bit register (awatthr, bwatthr, cwatthr, afwatthr, bfwatthr, and cfwatthr) depends on the configuration of bit 5 and bit 4 (consel bits) in the accmode[7:0] register. the various configurations are described in table 14 . table 14. inputs to watt-hour accumulation registers consel awat thr bwat thr cwat thr 00 va ia vb ib vc ic 01 va ia 0 vc ic 10 va ia vb ib vc ic vb = ?va ? vc 11 va ia vb ib vc ic vb = ?va depending on the polyphase meter service, choose the appropriate formula to calculate the active energy. the american ansi c12.10 standard defines the different configurations of the meter. tabl e 15 describes which mode should be chosen in these various configurations. table 15. meter form configuration ansi meter form configuration consel 5s/13s 3-wire delta 01 6s/14s 4-wire wye 10 8s/15s 4-wire delta 11 9s/16s 4-wire wye 00 bits[1:0] (wattacc[1:0]) in the accmode[7:0] register determine how the cf frequency output can be generated as a function of the total and fundamental active powers. whereas the watt-hour accumulation registers accumulate the active power in a signed format, the frequency output can be generated in signed mode or in absolute mode as a function of the wattacc[1:0] bits. see the energy-to-frequency conversion section for details. line cycle active energy accumulation mode in line cycle energy accumulation mode, the energy accumula- tion is synchronized to the voltage channel zero crossings such that active energy is accumulated over an integral number of half-line cycles. the advantage of summing the active energy over an integer number of line cycles is that the sinusoidal compo- nent in the active energy is reduced to 0. this eliminates any ripple in the energy calculation and allows the energy to be accumulated accurately over a shorter time. by using the line cycle energy accumulation mode, the energy calibration can be greatly simplified, and the time required to calibrate the meter can be significantly reduced. in line cycle energy accumulation mode, the ADE7878 transfers the active energy accumulated in the 32-bit internal accumulation registers into the xwathhr[31:0] or xfwatthr[31:0] register after an integral number of line cycles, as shown in figure 64 . the number of half-line cycles is specified in the linecyc[15:0] register. zero crossing detection (phase a) zero crossing detection (phase b) calibration control zero crossing detection (phase c) linecyc[15:0] awatthr[31:0] zxsel[0] in lcycmode[7:0] zxsel[1] in lcycmode[7:0] zxsel[2] in lcycmode[7:0] output from lpf2 awgain awatto s accumul ator wthr[47:0] 32 bit register 08510-047 figure 64. line cycle active energy accumulation mode the line cycle energy accumulation mode is activated by setting bit 0 (lwatt) in the lcycmode[7:0] register. the energy accu- mulation over an integer number of half-line cycles is written to the watt-hour accumulation registers after linecyc[15:0] number of half-line cycles are detected. when using the line cycle accumulation mode, the bit 6 (rstread) of the lcycmode[7:0] register should be set to logic 0 because the read with reset of watt-hour registers is not available in this mode. phase a, phase b, and phase c zero crossings are, respectively, included when counting the number of half-line cycles by setting bits[5:3] (zxsel) in the lcycmode[7:0] register. any combi- nation of the zero crossings from all three phases can be used for counting the zero crossing. select only one phase at a time for inclusion in the zero crossings count during calibration. the number of zero crossings is specified by the linecyc[15:0] 16-bit unsigned register. the ADE7878 can accumulate active power for up to 65,535 combined zero crossings. note that the internal zero-crossing counter is always active. by setting bit 0 (lwatt) in the lcycmode[7:0] register, the first energy accumulation result is, therefore, incorrect. writing to the linecyc[15:0] register when the lwatt bit is set resets the zero-crossing counter, thus ensuring that the first energy accumulation result is accurate. at the end of an energy calibration cycle, bit 5 (lenergy) in the status0[31:0] register is set. if the corresponding mask bit in the mask0[31:0] interrupt mask register is enabled, the irq0 pin also goes active low. the status bit is cleared and the
ADE7878 rev. 0 | page 47 of 92 irq0 pin is set to high again by writing to the status0 register with the corresponding bit set to 1. because the active power is integrated on an integer number of half-line cycles in this mode, the sinusoidal components are reduced to 0, eliminating any ripple in the energy calculation. therefore, total energy accumulated using the line cycle accumulation mode is () () = + ? = = 1 cos k kkkk ntt t ivntdttp e (28) where nt is the accumulation time. note that line cycle active energy accumulation uses the same signal path as the active energy accumulation. the lsb size of these two methods is equivalent. reactive power calculation the ADE7878 computes the total reactive power on every phase. total reactive power integrates all fundamental and harmonic components of the voltages and currents. ADE7878 also computes the fundamental reactive power, the power determined only by the fundamental components of the voltages and currents. a load that contains a reactive element (inductor or capacitor) produces a phase difference between the applied ac voltage and the resulting current. the power associated with reactive elements is called reactive power, and its unit is var. reactive power is defined as the product of the voltage and current waveforms when all harmonic components of one of these signals are phase shifted by 90. equation 31 gives an expression for the instantaneous reactive power signal in an ac system when the phase of the current channel is shifted by +90. = = 1 2)( k k vtv sin( kt + k ) (29) () k k k tkiti + = = sin2)( 1 (30) ? ? ? ? ? ? ++ = = 2 sin2)(' 1 tkiti k k k where i?(t) is the current waveform with all harmonic components phase shifted by 90. next, the instantaneous reactive power q(t) can be expressed as q(t) = v(t) i?(t) (31) = = 1 2 )( k kk ivtq sin( kt + k ) sin( kt + k + 2 ) + 2sin( kt + k ) sin( mt + m + = mk mk m k iv 1, 2 ) note that q ( t ) can be rewritten as = = 1 )( k kk ivtq { cos ( k ? k ? 2 ) ? cos ( 2 kt + k + k + 2 ) } + = mk mk m k iv 1, { cos [ ( k C m ) t + k ? k ? 2 ] } (32) the average total reactive power over an integral number of line cycles (n) is given by the expression in equation 33. () = = = nt 0 1 dt nt 1 k kk ivtqq cos( k C k ? 2 ) (33) = = 1 k kk ivq sin( k C k ) where: t is the period of the line cycle. q is referred to as the total reactive power. note that the total reactive power is equal to the dc component of the instantaneous reactive power signal q(t) in equation 32, that is, = 1 k kk iv sin( k C k ) this is the relationship used to calculate the total reactive power in the ADE7878 for each phase. the instantaneous reactive power signal q(t) is generated by multiplying each harmonic of the voltage signals by the 90 phase-shifted corresponding harmonic of the current in each phase. the ADE7878 stores the instantaneous total phase reactive powers into the avar[23:0], bvar[23:0], and cvar[23:0] registers. their expression is = = 1 k fs k fs k i i u u xvar sin( k C k ) pmax 4 2 1 (34) where: u fs , i fs are the rms values of the phase voltage and current when the adc inputs are at full scale. pmax = 33,516,139, the instantaneous power computed when the adc inputs are at full scale and in phase. the xvar[23:0] waveform registers can be accessed using various serial ports. refer to the wavefor m sampling mo de section for more details. the expression of fundamental reactive power is obtained from equation 37 with k = 1, as follows: fq = v 1 i 1 cos( 1 C 1 ) the ADE7878 computes the fundamental reactive power using a proprietary algorithm that requires some initialization function of the frequency of the network and its nominal voltage measured in the voltage channel. these initializations are introduced in the active power calculation section and are common for both fundamental active and reactive powers.
ADE7878 rev. 0 | page 48 of 92 table 16 presents the settling time for the fundamental reactive power measurement, which is the time it takes the power to reflect the value at the input of theADE7878. table 16. settling time for fundamental reactive power input signals 63% full scale 100% full scale 375 ms 875 ms reactive power gain calibration the average reactive power from the lpf output in each phase can be scaled by 100% by writing to the phases var gain 24-bit register (avargain[23:0], bvargain[23:0], cvargain[23:0], afvargain[23:0], bfvargain[23:0], or cfvargain[23:0]). the xvargain registers are placed in each phase of the total reactive power datapath. the xfvargain registers are placed in each phase of the fundamental reactive power datapath. the xvargain registers are twos complement signed registers and have a resolution of 2 ?23 /lsb. the function of the xvargain registers is expressed by ? ? ? ? ? ? + = 23 2 1 2 gisterre xvargain output lpf powe r reactive average (35) th e output is scaled by C50% by writing 0xc00000 to the xvargain registers and increased by +50% by writing 0x400000 to them. these registers can be used to calibrate the reactive power (or energy) gain in the ADE7878 for each phase. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words, and the dsp works on 28 bits. similar to registers presented in figure 32 , the avargain, bvargain, cvargain, afvargain, bfvargain, and cfvargain 24-bit signed registers are accessed as 32-bit registers with the four msbs padded with 0s and sign extended to 28 bits. reactive power o ffset calibration the ADE7878 provides a reactive power offset register on each phase and on each reactive power. the avaros[23:0], bvaros[23:0], and cvaros[23:0] registers compensate the offsets in the total reactive power calculations, whereas the afvaros[23:0], bfvaros[23:0], and cfvaros[23:0] registers compensate offsets in the fundamental reactive power calculations. these are signed twos complement 24-bit registers that are used to remove offsets in the reactive power calculations. an offset can exist in the power calculation due to crosstalk between channels on the pcb or in the chip itself. the offset calibration allows the contents of the reactive power register to be maintained at 0 when no reactive power is being consumed. the offset resolution of the registers is the same as for the active power offset registers (see the active power offset calibration section). as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words, and the dsp works on 28 bits. similar to registers presented in figure 32 , the avaros, bvaros, and cvaros 24-bit signed registers are accessed as 32-bit registers with the four msbs padded with 0s and sign extended to 28 bits. sign of reactive power calculation note that the reactive power is a signed calculation. table 17 summarizes the relationship between the phase difference between the voltage and the current and the sign of the resulting reactive power calculation. the ADE7878 has a sign detection circuitry for reactive power calculations. it can monitor the total reactive powers or the fundamental reactive powers. as described in the reactive energy calculation section, the reactive energy accumulation is executed in two stages. every time a sign change is detected in the energy accumulation at the end of the first stage, that is, after the energy accumulated into the 48-bit accumulator reaches the varthr[47:0] register threshold, a dedicated interrupt is triggered. the sign of each phase reactive power can be read in the phsign[15:0] register. bit 7 (revrpsel) in the accmode[7:0] register sets the type of reactive power being monitored. when revrpsel is 0, the default value, the total reactive power is monitored. when revrpsel is 1, then the fundamental reactive power is monitored. bits[12:10] (revrpc, revrpb, and revrpa, respectively) in the status0[31:0] register are set when a sign change occurs in the power selected by bit 7 (revrpsel) in the accmode[7:0] register. bits[6:4] (cvarsign, bvarsign, and avarsign, respectively) in the phsign[15:0] register are set simultaneously with the revrpc, revrpb, and revrpa bits. they indicate the sign of the reactive power. when they are 0, the reactive power is positive. when they are 1, the reactive power is negative. bit revrpx in the status0[31:0] register and bit xvarsign in the phsign[15:0] register refer to the reactive power of phase x, the power type being selected by bit revrpsel in accmode[7:0] register. setting bits[12:10] in the mask0[31:0] register enables the revrpc, revrpb, and revrpa interrupts, respectively. if enabled, the irq0 pin is set low and the status bit is set to 1 whenever a change of sign occurs. to find the phase that triggered the interrupt, the phsign[15:0] register is read immediately after reading the status0[31:0] register. next, the status bit is cleared and the irq0 pin is set to high by writing to the status0 register with the corresponding bit set to 1.
ADE7878 rev. 0 | page 49 of 92 table 17. sign of reactive power calculation 1 integrator sign of reactive power between 0 to +90 off positive between ?90 to 0 off negative between 0 to +90 on positive between ?90 to 0 on negative 1 is defined as the phase angle of the voltage signal minus the current signal; that is, is positive if the load is inductive and negative if the load is capacitive. reactive energy calculation reactive energy is defined as the integral of reactive power. reactive energy = q(t)dt (36) both total and fundamental reactive energy accumulations are always a signed operation. negative energy is subtracted from the reactive energy contents. similar to active power, the ADE7878 achieves the integration of the reactive power signal in two stages (see figure 65 ). the process is identical for both total and fundamental active powers. ? t he first stage is conducted inside the dsp: every 125 s (8 khz frequency), the instantaneous phase total reactive or fundamental power is accumulated into an internal register. when a threshold is reached, a pulse is generated at processor port and the threshold is subtracted from the internal register. the sign of the energy in this moment is considered the sign of the reactive power (see the sign of reactive power calculation section for details). ? the second stage is done outside the dsp and consists of accumulating the pulses generated by the processor into internal 32-bit accumulation registers. the content of these registers is transferred to the var-hour registers (registers xvarhr[31:0] and xfvarhr[31:0]) when these registers are accessed. avarhr[31:0], bvarhr[31:0], cvarhr[31:0], afwatthr[31:0], bfwatthr[31:0], and cfwatthr[31:0] represent phase fundamental reactive powers. figure 62 in the active energy calculation section explains this process. the varthr[47:0] 48-bit signed register contains the threshold, and it is introduced by the user. it is common for both total and fundamental phase reactive powers. its value depends on how much energy is assigned to one lsb of var- hour registers. supposing a derivative of a volt ampere reactive hour (varh) at [10 n varh] where n is an integer is desired as one lsb of the varhr register. then, the varthr register can be computed using the following equation: fsfs n s iu fpmax varthr ? = 103600 where: pmax = 33,516,139 = 0x1ff6a6b, the instantaneous power computed when the adc inputs are at full scale. f s = 8 khz, the frequency with which the dsp computes the instantaneous power. u fs , i fs are the rms values of phase voltages and currents when the adc inputs are at full scale. the maximum value that may be written on varthr[47:0] is 2 47 ? 1. the minimum value is 0x0, but it is recommended to write a number equal to or greater than pmax. never use negative numbers. the varthr[47:0] is a 48-bit register. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. similar to the wthr[47:0] register shown in figure 63 , varthr[47:0] is accessed as two 32-bit registers (varthr1[31:0] and varthr0[31:0]), each having eight msbs padded with 0s. this discrete time accumulation or summation is equivalent to integration in continuous time following the expression in equation 37 () () ? ? ? ? ? ? == = 0 0t lim re n tntq dttqgy activeener (37) where: n is the discrete time sample number. t is the sample period. on the ADE7878, the total phase reactive powers are accumulated in the avarhr[31:0], bvarhr[31:0], and cvarhr[31:0] 32-bit signed registers. the fundamental phase reactive powers are accumulated in the afvarhr[31:0], bfvarhr[31:0], and cfvarhr[31:0] 32-bit signed registers. the reactive energy register content can roll over to full-scale negative (0x80000000) and continue increasing in value when the reactive power is positive. conversely, if the reactive power is negative, the energy register underflows to full-scale positive (0x7fffffff) and continues to decrease in value. bit 2 (rehf) in the status0[31:0] register is set when bit 30 of one of the xvarhr registers changes, signifying that one of these registers is half full. if the reactive power is positive, the var-hour register becomes half full when it increments from 0x3fff ffff to 0x4000 0000. if the reactive power is negative, the var-hour register becomes half full when it decrements from 0xc000 0000 to 0xbfff ffff. analogously, bit 3 (frehf) in the status0[31:0] register is set when bit 30 of one of the xfvarhr registers changes, signifying that one of these registers is half full. setting bits[3:2] in the mask0[31:0] register enables the frehf and rehf interrupts, respectively. if enabled, the irq0 pin is set low and the status bit is set to 1 whenever one of the
ADE7878 rev. 0 | page 50 of 92 energy registers, xvarhr (for rehf interrupt) or xfvarhr (for frehf interrupt), becomes half full. the status bit is cleared and the irq0 pin is set to high by writing to the status0 register with the corresponding bit set to 1. setting bit 6 (rstread) of lcymode[7:0] register enables a read-with-reset for all var-hour accumulation registers, that is, the registers are reset to 0 after a read operation. avgain hpfdis [23:0] hpf aigain hpfdis [23:0] digital integrator revrpa bit in status0[31:0] hpf va ia avargain avaros aphcal accumulator varthr[47:0] avarhr[31:0] 32 bit register total reactive power algorithm 08510-245 digital signal processor figure 65. total reactive energy accumulation
ADE7878 rev. 0 | page 51 of 92 integration time under a steady load the discrete time sample period (t) for the accumulation register is 125 s (8 khz frequency). with full-scale pure sinusoidal signals on the analog inputs and a 90 phase difference between the voltage and the current signal (the largest possible reactive power), the average word value representing the reactive power is pmax = 33,516,139 = 0x1ff6a6b. if the varthr[47:0] threshold is set at the pmax level, this means that the dsp generates a pulse that is added at the var-hour registers every 125 s. the maximum value that can be stored in the var-hour accumu- lation register before it overflows is 2 31 ? 1 or 0x7fffffff. the integration time is calculated as time = 0x7fff,ffff 125 s = 74 hr 33 min 55 sec (38) energy accumulation modes the reactive power accumulated in each var-hour accumulation 32-bit register (avarhr, bvarhr, cvarhr, afvarhr, bfvarhr, and cfvarhr) depends on the configuration of bits[5:4] (consel) in the accpmode[7:0] register, in correlation with the watt-hour registers. the different configurations are described in table 18 . note that ia /ib /ic are the phase-shifted current waveforms. table 18. inputs to var-hour accumulation registers consel[1,0] avarhr, afvarhr bvarhr, bfvarhr cvarhr, cfvarhr 00 va ia vb ib vc ic 01 va ia 0 vc ic 10 va ia vb ib vc x ic vb = ?va ? vc 11 va ia vb ib vc ic vb = ?va bits[3:2] (varacc[1:0]) in the accmode[7:0] register determine how cf frequency output can be a generated function of the total active and fundamental powers. while the var-hour accumulation registers accumulate the reactive power in a signed format, the frequency output may be generated in either the signed mode or the sign adjusted mode function of varacc[1:0]. see the energy-to-frequency conversion section for details. line cycle reactive energy accumulation mode as mentioned in the line cycle active energy accumulation mode section, in-line cycle energy accumulation mode, the energy accumulation can be synchronized to the voltage channel zero crossings so that reactive energy can be accumulated over an integral number of half-line cycles. in this mode, the ADE7878 transfers the reactive energy accumulated in the 32-bit internal accumulation registers into the xvarhr[31:0] or xfvar[31:0] register after an integral number of line cycles, as shown in figure 66 . the number of half-line cycles is specified in the linecyc[15:0] register. the line cycle reactive energy accumulation mode is activated by setting bit 1 (lvar) in the lcycmode[7:0] register. the total reactive energy accumulated over an integer number of half-line cycles or zero crossings is accumulated in the var-hour accumulation registers after the number of zero crossings specified in the linecyc register is detected. when using the line cycle accumulation mode, bit 6 (rstread) of the lcycmode[7:0] register should be set to logic 0 because a read with the reset of var-hour registers is not available in this mode. zero- crossing detection (phase a) zero- crossing detection (phase b) calibration control zero- crossing detection (phase c) linecyc[15:0] avarhr[31:0] zxsel[0] in lcycmode[7:0] zxsel[1] in lcycmode[7:0] zxsel[2] in lcycmode[7:0] output from total reactive power algorithm avarg ain avaros accumul ator 32-bit register varhr[47:0] 08510-146 figure 66. line cycle reactive energy accumulation mode phase a, phase b, and phase c zero crossings are, respectively, included when counting the number of half-line cycles by setting bits[5:3] (zxsel) in the lcycmode[7:0] register. any combination of the zero crossings from all three phases can be used for counting the zero crossing. select only one phase at a time for inclusion in the zero-crossings count during calibration. for details on setting the linecyc[15:0] register and bit 5 (lenergy) in the mask0 interrupt mask register associated with the line cycle accumulation mode, see the line cycle active energy accumulation mode section.
ADE7878 rev. 0 | page 52 of 92 the ADE7878 stores the instantaneous phase apparent powers into the ava[23:0], bva[23:0], and cva[23:0] registers. their expression is apparent power calculation apparent power is defined as the maximum power that can be delivered to a load. one way to obtain the apparent power is by multiplying the voltage rms value by the current rms value (also called the arithmetic apparent power) as follows: 4 2 1 = pmax i i u u xva fsfs (40) s = v rms i rms (39) where: u, i are the rms values of the phase voltage and current. where: u fs , i fs are the rms values of the phase voltage and current when the adc inputs are at full scale. s is the apparent power v rms and i rms are the rms voltage and current, respectively. pmax = 33,516,139, the instantaneous power computed when the adc inputs are at full scale and in phase. the ADE7878 computes the arithmetic apparent power on each phase. figure 67 illustrates the signal processing in each phase for the calculation of the apparent power in the ADE7878. because v rms and i rms contain all harmonic information, the apparent power computed by the ADE7878 is a total apparent power. the ADE7878 does not compute a fundamental apparent power because it does not measure the rms values of the funda- mental voltages and currents. the xva[23:0] waveform registers may be accessed using various serial ports. refer to the wavefor m sampling mo de section for more details. the ADE7878 can compute the apparent power in an alternative way by multiplying the phase rms current by an rms voltage introduced externally. see the apparent power calculation using vnom section for details. avahr[31:0] avagain digital signal processor airms accumulator avrms vathr[47:0] 32 bit register 08510-048 figure 67. apparent power data flow and apparent energy accumulation
ADE7878 rev. 0 | page 53 of 92 apparent power gain calibration the average apparent power result in each phase can be scaled by 100% by writing to the phases vagain 24-bit register (avagain[23:0], bvagain[23:0], or cvag ain[23:0]). the vagain registers are twos complement signed registers and have a resolution of 2 ?23 /lsb. the function of the xvagain registers is expressed mathematically as ? ? ? ? ? ? + = 23 2 1 register vagain irmsvrms powe r apparen t average (41) the output is scaled by C50% by writing 0xc00000 to the xvagain registers and increased by +50% by writing 0x400000 to them. these registers can be used to calibrate the apparent power (or energy) calculation in the ADE7878 for each phase. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words, and the dsp works on 28 bits. similar to registers presented in figure 32, the avagain, bvagain, and cvagain 24-bit registers are accessed as 32-bit registers with the four msbs padded with 0s and sign extended to 28 bits. apparent power o ffset calibration each rms measurement includes an offset compensation register to calibrate and eliminate the dc component in the rms value (see the root mean square measurement section). the voltage and current rms values are then multiplied together in the apparent power signal processing. because no additional offsets are created in the multiplication of the rms values, there is no specific offset compensation in the apparent power signal processing. the offset compensation of the apparent power measurement in each phase should be done by calibrating each individual rms measurement. apparent power calculation using vnom the ADE7878 can compute the apparent power by multiplying the phase rms current by an rms voltage introduced externally in the vnom[23:0] 24-bit signed register. when one of bits[13:11] (vnomcen, vnomben, or vnomaen) in the compmode[15:0] register is set to 1, the apparent power in the corresponding phase (phase x for vnomxen) is computed in this way. when the vnomxen bits are cleared to 0, the default value, then the arithmetic apparent power is computed. the vnom[23:0] register contains a number determined by u, the desired rms voltage, and u fs , the rms value of the phase voltage when the adc inputs are at full scale as follows: 910,191,4 = fs u u vnom (42) where u is the nominal phase rms voltage. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. similar to the register presented in figure 33, the vnom 24-bit signed register is accessed as a 32-bit register with the eight msbs padded with 0s. apparent energy calculation apparent energy is defined as the integral of apparent power. apparent energy = s ( t ) dt (43) similar to active and reactive powers, the ADE7878 achieves the integration of the apparent power signal in two stages (see figure 67). the first stage is conducted inside the dsp: every 125 s (8 khz frequency), the instantaneous phase apparent power is accumulated into an internal register. when a threshold is reached, a pulse is generated at the processor port, and the threshold is subtracted from the internal register. the second stage is conducted outside the dsp and consists of accumulating the pulses generated by the processor into internal 32-bit accumulation registers. the content of these registers is transferred to the va-hour registers, xvahr[31:0], when these registers are accessed. figure 62 from the active energy calculation section illustrates this process. the vathr[47:0] 48-bit register contains the threshold. its value depends on how much energy is assigned to one lsb of the va-hour registers. supposing a derivative of apparent energy (vah) of [10 n vah], where n is an integer, is desired as one lsb of the xvahr register, then, the xvathr register can be computed using the following equation: fsfs n s iu fpmax vathr = 103600 where: pmax = 33,516,139 = 0x1ff6a6b, the instantaneous power computed when the adc inputs are at full scale. f s = 8 khz, the frequency with which the dsp computes the instantaneous power. u fs , i fs are the rms values of the phase voltages and currents when the adc inputs are at full scale. vathr[47:0] is a 48-bit register. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. similar to the wthr[47:0] register presented in figure 63, vathr[47:0] is accessed as two 32-bit registers (vathr1[31:0] and vathr0[31:0]), each having eight msbs padded with 0s. this discrete time accumulation or summation is equivalent to integration in continuous time following the description in equation 44. () () ? ? ? ? ? ? == = 0 0t lim n tnts dttsergy apparenten (44)
ADE7878 rev. 0 | page 54 of 92 where: n is the discrete time sample number. t is the sample period. in the ADE7878, the phase apparent powers are accumulated in the avahr[31:0], bvahr[31:0], and cvahr[31:0] 32-bit signed registers. the apparent energy register content can roll over to full-scale negative (0x80000000) and continue increasing in value when the apparent power is positive. conversely, if because of offset compensation in the rms datapath, the apparent power is negative, the energy register underflows to full-scale positive (0x7fffffff) and continues to decrease in value. bit 4 (vaehf) in the status0[31:0] register is set when bit 30 of one of the xvahr registers changes, signifying that one of these registers is half full. because the apparent power is always positive and the xvahr registers are signed, the va-hour registers become half full when they increment from 0x3fffffff to 0x4000 0000. interrupts attached to bit vaehf in the status0[31:0] register can be enabled by setting bit 4 in the mask0[31:0] register. if enabled, the irq0 pin is set low and the status bit is set to 1 whenever one of the energy registers xvahr becomes half full. the status bit is cleared and the irq0 pin is set to high by writing to the status0 register with the corresponding bit set to 1. setting bit 6 (rstread) of the lcymode[7:0] register enables a read-with-reset for all xvahr accumulation registers; that is, the registers are reset to 0 after a read operation. integration time under steady load the discrete time sample period for the accumulation register is 125 s (8 khz frequency). with full-scale pure sinusoidal signals on the analog inputs, the average word value representing the apparent power is pmax. if the vathr threshold register is set at the pmax level, this means the dsp generates a pulse that is added at the xvahr registers every 125 s. the maximum value that can be stored in the xvahr accumulation register before it overflows is 2 31 ? 1 or 0x7fffffff. the integration time is calculated as time = 0x7fff,ffff 125 s = 74 hr 33 min 55 sec (45) energy accumulation mode the apparent power accumulated in each accumulation register depends on the configuration of bits[5:4] (consel) in the accmode[7:0] register. the various configurations are described in table 19 . table 19. inputs to va-hou r accumulation registers consel[1,0] avahr bvahr cvahr 00 avrms airms bvrms birms cvrms cirms 01 avrms airms 0 cvrms cirms 10 avrms airms bvrms birms cvrms cirms vb = ?va ? vc 11 avrms airms bvrms birms cvrms cirms vb = ?va line cycle apparent energy accumulation mode as described in the line cycle active energy accumulation mode section, in line cycle energy accumulation mode, the energy accumulation can be synchronized to the voltage channel zero crossings allowing apparent energy to be accumulated over an integral number of half-line cycles. in this mode, the ADE7878 transfers the apparent energy accumulated in the 32-bit internal accumulation registers into xvahr[31:0] registers after an integral number of line cycles, as shown in figure 68 . the number of half-line cycles is specified in the linecyc[15:0] register. zero- crossing detection (phase a) zero- crossing detection (phase b) calibration control zero- crossing detection (phase c) linecyc[15:0] avahr[31:0] zxsel[0] in lcycmode[7:0] zxsel[1] in lcycmode[7:0] zxsel[2] in lcycmode[7:0] avagain airms avrms accumul ator vahr[47:0] 32-bit register 08510-049 figure 68. line cycle apparent energy accumulation mode
ADE7878 rev. 0 | page 55 of 92 the line cycle apparent energy accumulation mode is activated by setting bit 2 (lva) in the lcycmode[7:0] register. the apparent energy accumulated over an integer number of zero crossings is written to the xvahr accumulation registers after the number of zero crossings specified in the linecyc register is detected. when using the line cycle accumulation mode, bit 6 (rstread) of the lcycmode[7:0] register should be set to logic 0 because a read with the reset of xvahr registers is not available in this mode. phase a, phase b, and phase c zero crossings are, respectively, included when counting the number of half-line cycles by setting bits[5:3] (zxsel) in the lcycmode[7:0] register. any combination of the zero crossings from all three phases can be used for counting the zero crossing. select only one phase at a time for inclusion in the zero-crossings count during calibration. for details on setting the linecyc[15:0] register and bit 5 (lenergy) in the mask0 interrupt mask register associated with the line cycle accumulation mode, see the line cycle active energy accumulation mode section. waveform sampling mode the waveform samples of the current and voltage waveform, the active, reactive, and apparent power multiplier outputs are stored every 125 s (8 khz rate) into 24-bit signed registers that can be accessed through various serial ports of the ADE7878. table 20 provides the list of registers and their descriptions. table 20. waveform registers list register description iawv phase a current vawv phase a voltage ibwv phase b current vbwv phase b voltage icwv phase c current vcwv phase c voltage inwv neutral current ava phase a apparent power register description bva phase b apparent power cva phase c apparent power awatt phase a active power bwatt phase b active power cwatt phase c active power avar phase a reactive power bvar phase b reactive power cvar phase c reactive power bit 17 (dready) in the status0[31:0] register can be used to signal when the registers listed in tabl e 20 can be read using the i 2 c or spi serial port. an interrupt attached to the flag can be enabled by setting bit 17 (dready) in the mask0[31:0] register. see the digital signal processor section for more details on bit dready. the ADE7878 contains a high speed data capture (hsdc) port that is specially designed to provide fast access to the waveform sample registers. read the hsdc interface section for more details. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. all registers listed in table 20 are trans- mitted sign extended from 24 bits to 32 bits (see figure 34 ). energy-to-freque ncy conversion the ADE7878 provides three frequency output pins: cf1, cf2, and cf3. the cf3 pin is multiplexed with the hsclk pin of the hsdc interface. when hsdc is enabled, the cf3 functionality is disabled at the pin. the cf1 and cf2 pins are always available. after initial calibration at manufacturing, the manufacturer or end customer verifies the energy meter calibration. one convenient way to verify the meter calibration is to provide an output frequency proportional to the active, reactive, or apparent power under steady load conditions. this output frequency can provide a simple, single-wire, optically isolated interface to external calibration equipment. figure 69 illustrates the energy-to-frequency conversion in the ADE7878. digital signal processor instantaneous phase a active power instantaneous phase b active power instantaneous phase c active power termselx bits in compmode wthr[47:0] frequency divider 2 7 2 7 va var fwatt fvar watt cfxsel bits in cfmode revpsumx bit of status0[31:0] cfxden accumulator cfx pulse output 08510-050 figure 69. energy-to-frequency conversion
ADE7878 rev. 0 | page 56 of 92 the dsp computes the instantaneous values of all phase powers: total active, fundamental active, total reactive, fundamental reactive, and apparent. the process in which the energy is sign accumulated in various xwatthr, xvarhr, and xvahr registers has already been described in the energy calculation sections. in the energy-to-frequency conversion process, the instantaneous powers are used to generate signals at the frequency output pins (cf1, cf2, and cf3). one digital- to-frequency converter is used for every cfx pin. every converter sums certain phase powers and generates a signal proportional to the sum. two sets of bits decide what powers are converted. first, bits[2:0] (termsel1[2:0]), bits[5:3] (termsel2[2:0]), and bits[8:6] (termsel3[2:0]) of the compmode[15:0] register decide which phases, or which combination of phases, are added. the termsel1 bits refer to the cf1 pin, the termsel2 bits refer to the cf2 pin, and the termsel3 bits refer to the cf3 pin. the termselx[0] bits manage phase a. when set to 1, phase a power is included in the sum of powers at the cfx converter. when cleared to 0, phase a power is not included. the termselx[1] bits manage phase b, and the termselx[2] bits manage phase c. setting all termselx bits to 1 means all 3-phase powers are added at the cfx converter. clearing all termselx bits to 0 means no phase power is added and no cf pulse is generated. second, bits[2: 0] (cf1sel[2:0]), bits[5:3] (cf2sel[2:0]), and bits[8:6] (cf3sel[2:0]) in the cfmode[15:0] register decide what type of power is used at the inputs of the cf1, cf2, and cf3 converters, respectively. table 21 shows the values that cfxsel can have: total active, total reactive, apparent, fundamental active, or fundamental reactive powers. by default, the termselx bits are all 1 and the cf1sel bits are 000, the cf2sel bits are 001, and the cf3sel bits are 010. this means that by default, the cf1 digital-to-frequency converter produces signals proportional to the sum of all 3-phase total active powers, cf2 produces signals proportional to total reactive powers, and cf3 produces signals proportional to apparent powers. table 21. cfxsel bits description cfxsel description registers latched when cfxlatch = 1 000 cfx signal proportional to the sum of total phase active powers awatthr, bwatthr, cwatthr 001 cfx signal proportional to the sum of total phase reactive powers avarhr, bvarhr, cvarhr 010 cfx signal proportional to the sum of phase apparent powers avahr, bvahr, cvahr 011 cfx signal proportional to the sum of fundamental phase active powers afwatthr, bfwatthr, cfwatthr 100 cfx signal proportional to the sum of fundamental phase reactive powers afvarhr, bfvarhr, cfvarhr 101 to 111 reserved similar to the energy accumulation process, the energy-to- frequency conversion is accomplished in two stages. in the first stage, the instantaneous phase powers obtained from the dsp at the 8 khz rate are shifted left by seven bits and then accumulate into an internal register at a 1 mhz rate. when a threshold is reached, a pulse is generated, and the threshold is subtracted from the internal register. the sign of the energy in this moment is considered the sign of the sum of phase powers (see the sign of sum-of-phase powers in the cfx datapath section for details). the threshold is the same threshold used in various active, reactive, and apparent energy accumulators in the dsp, wthr[47:0], varthr[47:0], or vathr[47:0] registers but this time it is shifted left by seven bits. the advantage of accumulating the instantaneous powers at the 1 mhz rate is that the ripple at the cfx pins is greatly diminished. the second stage consists of the frequency divider by cfxden[15:0] 16-bit unsigned registers. the values of cfxden depend on the meter constant (mc), measured in impulses/kwh and how much energy is assigned to one lsb of various energy registers: xwatthr, xvarhr, and so forth. supposing a derivative of wh [10 n wh], n a positive or negative integer, is desired as one lsb of the xwatthr register. then, cfxden is as follows: n mc cfxden 10]imp/kwh[ 10 3 = (46)
ADE7878 rev. 0 | page 57 of 92 the derivative of wh must be ch osen in such a way to obtain a cfxden register content greater than 1. if cfxden = 1, then the cfx pin stays active low for only 1 s; therefore, avoid this number. the frequency converter cannot accommodate fractional results; the result of the division must be rounded to the nearest integer. if cfxden is set equal to 0, then the ADE7878 considers it to be equal to 1. the pulse output for all digital-to-frequency converters stays low for 80 ms if the pulse period is larger than 160 ms (6.25 hz). if the pulse period is smaller than 160 ms and cfxden is an even number, the duty cycle of the pulse output is exactly 50%. if the pulse period is smaller than 160 ms and cfxden is an odd number, the duty cycle of the pulse output is (1+1/ cfxden ) 50% the pulse output is active low and preferably connected to an led, as shown in figure 70 . bits[11:9] (cf3dis, cf2dis, and cf1dis) of the cfmode[15:0] register decide if the frequency converter output is generated at the cf3, cf2, or cf1 pin. when bit cfxdis is set to 1 (the default value), the cfx pin is disabled and the pin stays high. when bit cfxdis is cleared to 0, the correspondent cfx pin output generates an active low signal. bits[16:14] (cf3, cf2, cf1) in the interrupt mask register mask0[31:0] manage the cf3, cf2, and cf1 related interrupts. when the cfx bits are set (whenever a high to low transition at the corresponding frequency converter output occurs), an interrupt irq0 is triggered and a status bit in the status0[31:0] register is set to 1. the interrupt is available even if the cfx output is not enabled by the cfxdis bits in the cfmode[15:0] register. v dd cfx pin 08510-051 figure 70. cfx pin recommended connection synchronizing energy registers with cfx outputs the ADE7878 contains a feature that allows synchronizing the content of phase energy accumulation registers with the generation of a cfx pulse. when a high-to-low transition at one frequency converter output occurs, the content of all internal phase energy registers that relate to the power being output at cfx pin is latched into hour registers and then resets to 0. see table 21 for the list of registers that are latched based on the cfxsel[2:0] bits in the cfmode[15:0] register. all 3-phase registers are latched independent of the termselx bits of the compmode[15:0] register. the process is shown in figure 71 for cf1sel[2:0] = 010 (apparent powers contribute at the cf1 pin) and cfcyc = 2. the cfcyc[7:0] 8-bit unsigned register contains the number of high-to-low transitions at the frequency converter output between two consecutive latches. writing a new value into the cfcyc[7:0] register during a high-to-low transition at any cfx pin should be avoided. cfcyc = 2 avahr, bvahr, cvahr latched energy registers reset avahr, bvahr, cvahr latched energy registers reset cf1 pulse based on phase a and phase b apparent powers 08510-052 figure 71. synchronizing avahr and bvahr with cf1 bits[14:12] (cf3latch, cf2latch and cf1latch) of the cfmode[15:0] register enable this process when set to 1. when cleared to 0, the default state, no latch occurs. the process is available even if the cfx output is not enabled by the cfxdis bits in the cfmode[15:0] register. cf outputs for various accumulation modes bits[1:0] (wattacc[1:0]) in the accmode[7:0] register determine the accumulation modes of the total active and fundamental powers when signals proportional to the active powers are chosen at the cfx pins (bit cfxsel[2:0] in the cfmode[15:0] register equals 000 or 011). when wattacc[1:0] = 00 (the default value), the active powers are sign accumulated before entering the energy-to-frequency converter. figure 72 shows how signed active power accumulation works. note that in this mode, the cfx pulses are synchronized perfectly with the active energy accumulated in xwatthr registers because the powers are sign accumulated in both datapaths. neg pos pos apnoload sign = positive neg no-load threshold active power no-load threshold a ctive ener g y revapx bit in status0 xwsign bit in phsign 08510-053 figure 72. active power signed accumulation mode
ADE7878 rev. 0 | page 58 of 92 when wattacc[1:0] = 11, the active powers are accumulated in absolute mode. when the powers are negative, they change sign and accumulate together with the positive power. figure 73 shows how absolute active power accumulation works. note that in this mode, the xwatthr registers continue to accumulate active powers in signed mode, even if the cfx pulses are generated based on the absolute accumulation mode. bits[3:2] (varacc[1:0]) in the accmode[7:0] register deter- mine the accumulation modes of the total and fundamental reactive powers when signals proportional to the reactive powers are chosen at the cfx pins (bit cfxsel[2:0] in the cfmode[15:0] register equals 001 or 100). when varacc[1:0] = 00, the default value, the reactive powers are sign accumulated before entering the energy-to-frequency converter. figure 74 shows how signed reactive power accumulation works. note that in this mode, the cfx pulses are synchronized perfectly with the reactive energy accumulated in the xvarhr registers because the powers are sign accumulated in both datapaths. neg pos pos apnoload sign = positive neg no-load threshold active power no-load threshold a ctive energy revapx bit in status0 xwsign bit in phsign 08510-054 figure 73. active power absolute accumulation mode neg pos pos varnoload sign = positive neg no-load threshold reactive power no-load threshold reactive energy revrpx bit in status0 x varsign bit in phsign 08510-153 figure 74. reactive power signed accumulation mode when varacc[1:0] = 10, the reactive powers are accumulated depending on the sign of the corresponding active power. if the active power is positive, the reactive power is accumulated as is. if the active power is negative, the sign of the reactive power is changed for accumulation. figure 75 shows how the sign adjusted reactive power accumulation mode works. note that in this mode, the xvarhr registers continue to accumulate reactive powers in signed mode, even if the cfx pulses are generated based on the sign adjusted accumulation mode. pos pos varnoload sign = positive neg no-load threshold no-load threshold no-load threshold reactive power active power reactive energy revrpx bit in status0 x varsign bit in phsign 08510-155 figure 75. reactive power accumulation in sign adjusted mode
ADE7878 rev. 0 | page 59 of 92 sign of sum-of-phase powers in the cfx datapath the ADE7878 has a sign detection circuitry for the sum of phase powers that are used in the cfx datapath. as seen in the beginning of the energy-to-frequency conversion section, the energy accumulation in the cfx datapath is executed in two stages. every time a sign change is detected in the energy accumulation at the end of the first stage, that is, after the energy accumulated into the 55-bit accumulator reaches one of wthr[47:0], varthr[47:0], or vathr[47:0] thresholds, a dedicated interrupt may be triggered synchronously with the corresponding cfx pulse. the sign of each sum can be read in the phsign[15:0] register. bit 18, bit 13, and bit 9 (revpsum3, revpsum2, and revpsum1, respectively) of the status0[31:0] register are set to 1 when a sign change of the sum of powers in cf3, cf2, or cf1 datapaths occurs. to correlate these events with the pulses generated at the cfx pins, after a sign change occurs, bit revpsum3, bit revpsum2, and bit revpsum1 are set in the same moment in which a high-to-low transition at the cf3, cf2, and cf1 pin, respectively, occurs. bit 8, bit 7, and bit 3 (sum3sign, sum2sign, and sum1sign, respectively) of the phsign[15:0] register are set in the same moment with bit revpsum3, bit revpsum2, and bit evpsum1 and indicate the sign of the sum of phase powers. when cleared to 0, the sum is positive. when set to 1, the sum is negative. interrupts attached to bit 18, bit 13, and bit 9 (revpsum3, revpsum2, and revpsum1, respectively) in the status0[31:0] register can be enabled by setting bits 18, bit 13, and bit 9 in the mask0[31:0] register. if enabled, the irq0 pin is set low and the status bit is set to 1 whenever a change of sign occurs. to find the phase that triggered the interrupt, the phsign[15:0] register is read immediately after reading the status0[31:0] register. next, the status bit is cleared and the irq0 pin is set high again by writing to the status0 register with the corresponding bit set to 1. no load condition the no load condition is defined in metering equipment standards as occurring when the voltage is applied to the meter and no current flows in the current circuit. to eliminate any creep effects in the meter, the ADE7878 contains three separate no load detection circuits: one related to the total active and reactive powers, one related to the fundamental active and reactive powers, and one related to the apparent powers. no load detection based on total active, reactive powers this no load condition is triggered when the absolute values of both phase total active and reactive powers are less than or equal to positive thresholds indicated in the apnoload[23:0] and respective varnoload[23:0] signed 24-bit registers. in this case, the total active and reactive energies of that phase are not accumulated, and no cfx pulses are generated based on these energies. the apnoload[23:0] register represents the positive no load level of active power relative to pmax, the maximum active power obtained when full-scale voltages and currents are provided at adc inputs. the varnoload[23:0] register represents the positive no load level of reactive power relative to pmax. the expression used to compute apnoload[23:0] signed 24-bit value is pmax i i u u apnoload fs noload fs n = (47) where: pmax = 3,516,139 = 0x1ff6a6b, the instantaneous power computed when the adc inputs are at full scale. u fs , i fs are the rms values of the phase voltages and currents when the adc inputs are at full scale. u n is the nominal rms value of phase voltage. i noload is the minimum rms value of phase current the meter starts measuring. the varnoload[23:0] register usually contains the same value as the apnoload[23:0] register. when apnoload and varnoload are set to negative values, the no load detection circuit is disabled. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words, and the dsp works on 28 bits. the apnoload and varnoload 24-bit signed registers are accessed as 32-bit registers with the four msbs padded with 0s and sign extended to 28 bits. see figure 32 for details. bit 0 (nload) in the status1[31:0] register is set when this no load condition in one of the three phases is triggered. bits[2:0] (nlphase[2:0]) in the phnoload[15:0] register indicate the state of all phases relative to a no load condition and are set simultaneously with bit nload in the status1[31:0] register. nlphase[0] indicates the state of phase a, nlphase[1] indicates the state of phase b, and nlphase[2] indicates the state of phase c. when bit nlphase[x] is cleared to 0, it means that the phase is out of a no load condition. when set to 1, it means that the phase is in a no load condition. an interrupt attached to bit 0 (nload) in the status1[31:0] register can be enabled by setting bit 0 in the mask1[31:0] register. if enabled, the irq1 pin is set to low and the status bit is set to 1 whenever one of three phases enters or exits this no load condition. to find the phase that triggered the interrupt, the phnoload[15:0] register is read immediately after reading the status1[31:0] register. then, the status bit is cleared and the irq1 pin is set to high by writing to the status1 register with the corresponding bit set to 1.
ADE7878 rev. 0 | page 60 of 92 no load detection based on fundamental active and reactive powers this no load condition is triggered when the absolute values of both phase fundamental active and reactive powers are less than or equal to apnoload[23:0] and the respective varnoload[23:0] positive thresholds. in this case, the fundamental active and reactive energies of that phase are not accumulated, and no cfx pulses are generated based on these energies. apnoload and varnoload are the same no load thresholds set for the total active and reactive powers. when apnoload and varno- load are set to negative values, this no load detection circuit is disabled. bit 1 (fnload) in the status1[31:0] register is set when this no load condition in one of the three phases is triggered. bits[5:3] (fnlphase[2:0]) in the phnoload[15:0] register indicate the state of all phases relative to a no load condition and are set simultaneously with bit fnload in status1[31:0]. fnlphase[0] indicates the state of phase a, fnlphase[1] indicates the state of phase b, and fnlphase[2] indicates the state of phase c. when bit fnlphase[x] is cleared to 0, it means the phase is out of the no load condition. when set to 1, it means the phase is in a no load condition. an interrupt attached to bit 1 (fnload) in the status1[31:0] register can be enabled by setting bit 1 in the mask1[31:0] register. if enabled, the 1 irq pin is set low and the status bit is set to 1 whenever one of three phases enters or exits this no load condition. to find the phase that triggered the interrupt, the phnoload[15:0] register is read immediately after reading status1[31:0]. then the status bit is cleared, and the 1irq pin is set back high by writing the status1 register with the corresponding bit set to 1. no load detection based on apparent power this no load condition is triggered when the absolute value of phase apparent power is less than or equal to the threshold indicated in the vanoload[23:0] 24-bit signed register. in this case, the apparent energy of that phase is not accumulated and no cfx pulses are generated based on this energy. the vanoload register represents the positive no load level of apparent power relative to pmax, the maximum apparent power obtained when full-scale voltages and currents are provided at the adc inputs. the expression used to compute the vanoload[23:0] signed 24-bit value is pmax i i u u vanoload fs noload fs n = (48) where: pmax = 33,516,139 = 0x1ff6a6b, the instantaneous apparent power computed when the adc inputs are at full scale. u fs , i fs are the rms values of the phase voltages and currents when the adc inputs are at full scale. u n is the nominal rms value of phase voltage. i noload is the minimum rms value of phase current the meter starts measuring. when the vanoload[23:0] register is set to negative values, the no load detection circuit is disabled. as previously stated, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words, and the dsp works on 28 bits. similar to the registers presented in figure 32 , the vanoload 24-bit signed register is accessed as a 32-bit register with the four msbs padded with 0s and sign extended to 28 bits. bit 2 (vanload) in the status1[31:0] register is set when this no load condition in one of the three phases is triggered. bits[8:6] (vanlphase[2:0]) in the phnoload[15:0] register indicate the state of all phases relative to a no load condition, and they are set simultaneously with bit vanload in the status1[31:0] register. bit vanlphase[0] indicates the state of phase a, bit vanlphase[1] indicates the state of phase b, and bit vanlphase[2] indicates the state of phase c. when bit vanlphase[x] is cleared to 0, it means that the phase is out of no load condition. when set to 1, it means that the phase is in no load condition. an interrupt attached to bit 2 (vanload) in the status1[31:0] register can be enabled by setting bit 2 in the mask1[31:0] register. if enabled, the irq1 pin is set low and the status bit is set to 1 whenever one of three phases enters or exits this no load condition. to find the phase that triggered the interrupt, the phnoload[15:0] register is read immediately after reading the status1[31:0] register. next, the status bit is cleared, and irq1 pin is set to high by writing to the status1 register with the corresponding bit set to 1. checksum register the ADE7878 has a checksum 32-bit register, checksum[31:0], that ensures that certain very important configuration registers maintain their desired value during normal power mode psm0. the registers covered by this register are mask0[31:0], mask1[31:0], compmode[15:0], gain[15:0], cfmode[15:0], cf1den[15:0], cf2den[15:0], cf3den[15:0], config[15:0], mmode[7:0], accmode[7:0], lcycmode[7:0], hsdc_cfg[7:0], and another six 8-bit reserved internal registers that always have default values. the ADE7878 computes the cyclic redundancy check (crc) based on the ieee802.3 standard. the registers are introduced one-by-one into a linear feedback shift register (lfsr) based generator starting with the least significant bit (as shown in figure 76 ). the 32-bit result is written in the checksum[31:0] register. after power-up or a hardware/
ADE7878 rev. 0 | page 61 of 92 all the other g i coefficients are equal to 0. software reset, the crc is computed on the default values of the registers, giving the result of 0x33666787. fb ( j ) = a j C 1 xor b 31 ( j C 1) (51) figure 77 shows how the lfsr works. bits[a 0 , a 1 ,, a 255 ] represent the bits from the list of registers presented previously in this section. bit a 0 is the least significant bit of the first internal register to enter lfsr; bit a 255 is the most significant bit of the mask0[31:0] register, the last register to enter lfsr. the formulas that govern lfsr are as follows: b 0 ( j ) = fb ( j ) and g 0 (52) b i (j) = fb ( j ) and g i xor b i ? 1 ( j C 1), i = 1, 2, 3, ..., 31 (53) equation 51, equation 52, and equation 53 must be repeated for j = 1, 2, , 256. the value written into the checksum[31:0] register contains the bit b i (256) , i = 0, 1, , 31. the value of the crc after the bits from the reserved internal register have passed through lfsr is 0x2d32a389. it is obtained at step j = 48. b i (0) = 1, i = 0, 1, 2, , 31, the initial state of the bits that form the crc. bit b 0 is the least significant bit, and bit b 31 is the most significant. two different approaches can be followed in using the checksum register. one is to compute the crc based on the relations (47) to (51) and then compare the value against the checksum register. another is to periodically read the checksum[31:0] register. if two consecutive readings differ, it can be assumed that one of the registers has changed value and, therefore, that the ADE7878 has changed configuration. the recommended response is to initiate a hardware/software reset that sets the values of all registers to the default, including the reserved ones, and then reinitialize the configuration registers. g i , i = 0, 1, 2, , 31 are the coefficients of the generating polynomial defined by the ieee802.3 standard as follows: g ( x ) = x 32 + x 26 + x 23 + x 22 + x 16 + x 12 + x 11 + x 10 + x 8 + x 7 + x 5 + x 4 + x 2 + x + 1 (49) g 0 = g 1 = g 2 = g 4 = g 5 = g 7 = 1 g 8 = g 10 = g 11 = g 12 = g 16 = g 22 = g 26 = 1 (50) 31 0 0 15 0 15 0 0 15 31 255 248 240 232 224 216 7070707 0 0 07 07 40 32 24 16 8 7 mask0 mask1 compmode cfmode gain internal register internal register internal register internal register internal register internal register lfsr generator 08510-055 figure 76. checksum[31:0] register calculation b 0 lfsr fb g 0 g 1 g 2 g 31 b 1 g 3 b 2 b 31 a 255 , a 254 ,...., a 2 , a 1 , a 0 08510-056 figure 77. lfsr generator used in checksum[31:0] register calculation
ADE7878 rev. 0 | page 62 of 92 interrupts the ADE7878 has two interrupt pins, irq0 and irq1 . each of the pins is managed by a 32-bit interrupt mask register, mask0[31:0] and mask1[31:0], respectively. to enable an interrupt, a bit in the maskx[31:0] register must be set to 1. to disable it, the bit must be cleared to 0. two 32-bit status registers, status0[31:0] and status1[31:0], are associated with the interrupts. when an interrupt event occurs in the ADE7878, the corresponding flag in the interrupt status register is set to a logic 1 (see and ). if the mask bit for this interrupt in the interrupt mask register is logic 1, then the table 31 table 32 irqx logic output goes active low. the flag bits in the interrupt status register are set irrespective of the state of the mask bits. to determine the source of the interrupt, the mcu should perform a read of the corresponding statusx register and identify which bit is set to 1. to erase the flag in the status register, statusx should be written back with the flag set to 1. after an interrupt pin goes low, the status register is read and the source of the interrupt is identified. then, the status register is written back without any change to clear the status flag to 0. the irqx pin remains low until the status flag is cancelled. by default, all interrupts are disabled. however, the rstdone interrupt is an exception. this interrupt can never be masked (disabled) and, therefore, bit 15 (rstdone) in the mask1[31:0] register does not have any functionality. the irq1 pin always goes low and bit 15 (rstdone) in the status1[31:0] is set to 1 whenever a power-up or a hardware/software reset process ends. to cancel the status flag, the status1[31:0] register must be written with bit 15 (rstdone) set to 1. certain interrupts are used in conjunction with other status registers: bit 0 (nload), bit1 (fnload), and bit 2 (vanload) in the mask1[31:0] register work in conjunction with status bits in the phnolad[15:0] register. bit 16, (sag), bit 17 (oi), and bit 18 (ov) in the mask1[31:0] register work with status bits in the phstatus[15:0] register. bit 23 (pki) and bit 24 (pkv) in the mask1[31:0] register work with status bits in the ipeak[31:0] and vpeak[31:0], respectively. bits[6:8] (revapx), bits[10:12] (revrpx), and bit 9, bit 13, and bit 18 (revpsumx) in the mask0[31:0] register work with the status bits in the phsign[15:0] register. when the statusx[31:0] register is read and one of these bits is set to 1, the status register associated with the bit is immediately read to identify the phase that triggered the interrupt, and only at that time can the statusx[31:0] register be written back with the bit set to 1. using the interrupts with an mcu figure 78 shows a timing diagram that illustrates a suggested implementation of the ADE7878 interrupt management using an mcu. at time t 1 , the irqx pin goes active low indicating that one or more interrupt events occurred in the ADE7878. tie the irqx pin to a negative-edge-triggered external interrupt on the mcu. on detection of the negative edge, configure the mcu to start executing its interrupt service routine (isr). on entering the isr, disable all interrupts using the global interrupt mask bit. at this point, the mcu external interrupt flag can be cleared to capture interrupt events that occur during the current isr. when the mcu interrupt flag is cleared, a read from statusx, the interrupt status register, is carried out. the interrupt status register content is used to determine the source of the interrupt(s) and, hence, the appropriate action to be taken. next, the same statusx content is written back into the ADE7878 to clear the status flag(s) and reset the irqx line to logic high (t 2 ). if a subsequent interrupt event occurs during the isr (t 3 ), that event is recorded by the mcu external interrupt flag being set again. on returning from the isr, the global interrupt mask bit is cleared (same instruction cycle), and the external interrupt flag uses the mcu to jump to its isr once again. this ensures that the mcu does not miss any external interrupts. figure 79 shows a recommended timing diagram when the status bits in the statusx registers work in conjunction with bits in other registers. same as previously described, when the irqx pin goes active low, the statusx register is read and if one of these bits is 1, then a second status register is read immediately to identify the phase that triggered the interrupt. the name, phx, in denotes one of the phstatus, ipeak, vpeak, or phsign registers. then, statusx is written back to clear the status flag(s). figure 79 jump to isr global interrupt mask clear mcu interrupt flag read statusx jump to isr write back statusx isr action (based on statusx contents) isr return global interrupt mask reset mcu interrupt flag set program s equence t 1 t 2 t 3 irqx 0 8510-057 figure 78. interrupt management
ADE7878 rev. 0 | page 63 of 92 jump to isr global interrupt mask clear mcu interrupt flag read statusx read phx jump to isr write back statusx isr action (based on statusx contents) isr return global interrupt mask reset mcu interrupt flag set program sequence t 1 t 2 t 3 irqx 08510-058 figure 79. interrupt management when phstatus, ipeak, vpeak, or phsign registers is involved serial interfaces the ADE7878 have three serial port interfaces: one fully licensed i 2 c interface, one serial peripheral interface (spi), and one high speed data capture port (hsdc). because the spi pins are multiplexed with some of the pins of the i 2 c and hsdc ports, the ADE7878 accepts two configurations: one using the spi port only and one using the i 2 c port in conjunction with the hsdc port. serial interface choice after reset, the hsdc port is always disabled. the choice between the i 2 c and spi port is done by manipulating the ss pin after power-up or after a hardware reset. if the ss pin is kept high, then the ADE7878 uses the i 2 c port until a new hardware reset is executed. if the ss pin is toggled high to low three times after power-up or after a hardware reset, the ADE7878 uses the spi port until a new hardware reset is executed. this manipulation of the ss pin can be accomplished in two ways. use the ss pin of the master device (that is, the microcontroller) as a regular i/o pin and toggle it three times, or execute three spi write operations to a location in the address space that is not allocated to a specific ADE7878 register (for example 0xebff, where eight bit writes can be executed). these writes allow the ss pin to toggle three times. see the section for details on the write protocol involved. spi write operation after the serial port choice is completed, it must be locked so that the active port remains in use until a hardware reset is executed in psm0 normal mode or until a power-down. if i 2 c is the active serial port, bit 1 (i2c_lock) of the config2[7:0] register must be set to 1 to lock it in. from this moment, the ADE7878 ignores spurious toggling of the ss pin, and an eventual switch into using the spi port is no longer possible. if the spi is the active serial port, any write to the config2[7:0] register locks the port. from this moment, a switch into using the i 2 c port is no longer possible. once locked, the serial port choice is maintained when the ADE7878 changes psmx power modes. the functionality of the ADE7878 is accessible via several on- chip registers. the contents of these registers can be updated or read using the i 2 c or spi interface. the hsdc port provides the state of up to 16 registers representing instantaneous values of phase voltages and neutral currents, and active, reactive, and apparent powers. i 2 c-compatible interface the ADE7878 supports a fully licensed i 2 c interface. the i 2 c interface is implemented as a full hardware slave. sda is the data i/o pin, and scl is the serial clock. these two pins are shared with the mosi and sclk pins of the on-chip spi interface. the maximum serial clock frequency supported by this interface is 400 khz. the two pins used for data transfer, sda and scl, are configured in a wire-anded format that allows arbitration in a multi- master system. the transfer sequence of an i 2 c system consists of a master device initiating a transfer by generating a start condition while the bus is idle. the master transmits the address of the slave device and the direction of the data transfer in the initial address transfer. if the slave acknowledges, then the data transfer is initiated. this continues until the master issues a stop condition and the bus becomes idle. i 2 c write operation the write operation using the i 2 c interface of the ADE7878 initiates when the master generates a start condition and consists of one byte representing the address of the ADE7878 followed by the 16-bit address of the target register and by the value of the register. the most significant seven bits of the address byte constitute the address of the ADE7878, and they are equal to 0111000b. bit 0 of the address byte is a read/ write bit. because this is a write operation, it must be cleared to 0; therefore, the first byte of the write operation is 0x70. after every byte is received, the ADE7878 generates an acknowledge. because registers may have 8, 16, or 32 bits, after the last bit of the register is transmitted and the ADE7878 acknowledges the transfer, the master generates a stop condition. the addresses and the register content are sent with the most significant bit first. see for details of the i 2 c write operation. figure 80 i 2 c read operation the read operation using the i 2 c interface of the ADE7878 is accomplished in two stages. the first stage sets the pointer to the address of the register. the second stage reads the content of the register. as seen in figure 81 , the first stage initiates when the master generates a start condition and consists of one byte representing
ADE7878 rev. 0 | page 64 of 92 the address of the ADE7878 followed by the 16-bit address of the target register. the ADE7878 acknowledges every byte received. the address byte is similar to the address byte of a write operation and is equal to 0x70 (see the i 2 c write operation section for details). after the last byte of the register address has been sent and it has been acknowledged by the ADE7878, the second stage begins with the master generating a new start condition followed by an address byte. the most significant seven bits of this address byte constitute the address of the ADE7878, and they are equal to 0111000b. bit 0 of the address byte is a read/ write bit. because this is a read operation, it must be set to 1; thus, the first byte of the read operation is 0x71. after this byte is received, the ADE7878 generates an acknowledge. then, the ADE7878 sends the value of the register, and after every eight bits are received, the master generates an acknowledge. all the bytes are sent with the most significant bit first. because registers can have 8, 16, or 32 bits, after the last bit of the register is received, the master does not acknowledge the transfer but generates a stop condition. ack generated by ADE7878 start stop s a c k a c k a c k a c k a c k a c k a c k s 0 15 slave address ms 8 bits of register address ls 8 bits of register address byte 3 (ms) of register byte 2 of register byte 1 of register byte 0 (ls) of register 87 031 1615 87 0 0 7 1110000 08510-059 figure 80. i 2 c write operation of a 32-bit register ack generated by ADE7878 ack generated by master start s a c k a c k a c k 0 15 slave address msb 8 bits of register address lsb 8 bits of register address 87 0 1110000 start stop s a c k a c k a c k a c k s 0 slave address byte 3 (msb) of register byte 2 of register byte 1 of register byte 0 (lsb) of register 31 16 15 8 7 0 0 7 1110001 ack generated by ADE7878 n o a c k 08510-060 figure 81. i 2 c read operation of a 32-bit register
ADE7878 rev. 0 | page 65 of 92 spi-compatible interface the spi of the ADE7878 is always a slave of the communication and consists of four pins: sclk, mosi, miso, and ss . the serial clock for a data transfer is applied at the sclk logic input. this logic input has a schmitt trigger input structure that allows slow rising (and falling) clock edges to be used. all data transfer operations are synchronized to the serial clock. data is shifted into the ADE7878 at the mosi logic input on the falling edge of sclk, and the ADE7878 samples it on the rising edge of sclk. data is shifted out of the ADE7878 at the miso logic output on a falling edge of sclk and can be sampled by the master device on the rising edge of sclk. the most significant bit of the word is shifted in and out first. the maximum serial clock frequency supported by this interface is 2.5 mhz. miso stays in high impedance when no data is transmitted from the ADE7878. presents details of the connection between the ADE7878 spi and a master device containing an spi interface. figure 82 the ss logic input is the chip select input. this input is used when multiple devices share the serial bus. the ss input should be driven low for the entire data transfer operation. bringing ss high during a data transfer operation aborts the transfer and places the serial bus in a high impedance state. a new transfer can then be initiated by bringing the ss logic input back low. however, because aborting a data transfer before completion leaves the accessed register in a state that cannot be guaranteed, every time a register is written, its value should be verified by reading it back. the protocol is similar to the protocol used in i 2 c interface. mosi miso sclk ADE7878 mosi miso sck spi device ss ss 08510-061 figure 82. connecting ADE7878 spi with an spi device spi read operation the read operation using the spi interface of the ADE7878 initiates when the master sets the ss pin low and begins sending one byte representing the address of the ADE7878 on the mosi line. the master sets data on the mosi line starting with the first high-to-low transition of sclk. the spi of the ADE7878 samples data on the low-to-high transitions of sclk. the most significant seven bits of the address byte can have any value, but as a good programming practice, they should be different from 0111000b, the seven bits used in the i 2 c protocol. bit 0 (read/ write ) of the address byte must be 1 for a read operation. next, the master sends the 16-bit address of the register that is read. after the ADE7878 receives the last bit of address of the register on a low-to-high transition of sclk, it begins to transmit its contents on the miso line when the next sclk high-to-low transition occurs; thus, the master can sample the data on a low-to-high sclk transition. after the master receives the last bit, it sets the ss and sclk lines high and the communication ends. the data lines, mosi and miso, go into a high impedance state. see for details of the spi read operation. figure 83 spi write operation the write operation using the spi interface of the ADE7878 initiates when the master sets the ss pin low and begins sending one byte representing the address of the ADE7878 on the mosi line. the master sets data on the mosi line starting with the first high-to-low transition of sclk. the spi of the ADE7878 samples data on the low-to-high transitions of sclk. the most significant seven bits of the address byte can have any value, but as a good programming practice, they should be different from 0111000b, the seven bits used in the i 2 c protocol. bit 0 (read/ write ) of the address byte must be 0 for a write operation. next, the master sends the 16-bit address of the register that is written and the 32-, 16-, or 8-bit value of that register without losing any sclk cycle. after the last bit is transmitted, the master sets the ss and sclk lines high at the end of sclk cycle and the communication ends. the data lines mosi and miso go into high impedance state. see figure 84 for details of the spi write operation. hsdc interface the high speed data capture (hsdc) interface is disabled after default. it can be used only if the ADE7878 is configured with an i 2 c interface. the spi interface cannot be used in conjunc- tion with hsdc. bit 6 (hsdcen) in the config[15:0] register activates hsdc when set to 1. if bit hsdcen is cleared to 0, the default value, the hsdc interface is disabled. setting bit hsdcen to 1 when spi is in use does not have any effect.
ADE7878 rev. 0 | page 66 of 92 1 0 15 14 sclk mosi miso 10 31 30 1 0 0 0 0 000 register value register address ss 08510-062 figure 83. spi read operation of a 32-bit register 0 15 14 sclk mosi 103130 10 0 0 0 0000 register address register value ss 08510-063 figure 84. spi write operation of a 32-bit register hsdc is an interface that is used to send to an external device, usually a microprocessor or a dsp, up to sixteen 32-bit words. the words represent the instantaneous values of the phase currents and voltages, neutral current, and active, reactive, and apparent powers. the registers being transmitted are: iawv[23:0], vawv[23:0], ibwv[23:0], vbwv[23:0], icwv[23:0], vcwv[23:0], ava[23:0], inwv[23:0], bva[23:0], cva[23:0], awatt[23:0], bwatt[23:0], cwatt[23:0], avar[23:0], bvar[23:0], and cvar[23:0]. all are 24-bit registers that are sign extended to 32-bits (see figure 34 for details). hsdc can be interfaced with spi or similar interfaces. hsdc is always a master of the communication and consists of three pins: hsa, hsd, and hsclk. hsa represents the select signal. it stays active low or high when a word is transmitted and is usually connected to the select pin of the slave. hsd is used to send data to the slave and is usually connected to the data input pin of the slave. hsclk is the serial clock line. it is generated by the ADE7878 and is usually connected to the serial clock input of the slave. figure 85 presents the connections between the ADE7878 hsdc and slave devices containing an spi interface. the hsdc communication is managed by the hsdc_cfg[7:0] register (see table 22). it is recommended to set the hsdc_cfg register to the desired value before enabling the port using bit 6 (hsdcen) in the config[15:0] register. in this way, the state of various pins belonging to the hsdc port do not take levels incon- sistent with the desired hsdc behavior. after a hardware reset or after power-up, the miso/hsd and ss /hsa pins are set high. bit 0 (hclk) in the hsdc_cfg[7:0] register determines the serial clock frequency of the hsdc communication. when hclk is 0 (the default value), the clock frequency is 8 mhz. when hclk is 1, the clock frequency is 4 mhz. a bit of data is transmitted for every hsclk high-to-low transition. the slave device that receives data from hsdc samples the hsd line on the low-to-high transition of hsclk. hsd hsclk hsa ADE7878 mosi sck ss spi device 08510-064 figure 85. connecting the ADE7878 hsdc with an spi the words can be transmitted as 32-bit packages or as 8-bit packages. when bit 1 (hsize) in the hsdc_cfg[7:0] register is 0 (the default value), the words are transmitted as 32-bit packages. when bit hsize is 1, the registers are transmitted as 8-bit pack- ages. the hsdc interface transmits the words msb first. bit 2 (hgap) introduces a gap of seven hsclk cycles between packages, when bit 2 (hgap) is set to 1. when bit hgap is cleared to 0 (the default value), no gap is introduced between packages and the communication time is shortest. in this case, hsize does not have any influence on the communication, and a bit is put on the hsd line every hsclk high-to-low transition. bits[4:3] (hxfer[1:0]) decide how many words are transmitted. when hxfer[1:0] is 00, the default value, then all 16 words are transmitted. when hxfer[1:0] is 01, only the words representing the instantaneous values of the phase and neutral currents and phase voltages are transmitted in the following order: iawv, vawv, ibwv, vbwv, icwv, vcwv, and one 32-bit word that is always equal to inwv.
ADE7878 rev. 0 | page 67 of 92 table 22. hsdc_cfg register bit location bit name default value description 0 hclk 0 0: hsclk is 8 mhz. 1: hsclk is 4 mhz. 1 hsize 0 0: hsdc transmits the 32-bit registers in 32-bit packages, most significant bit first. 1: hsdc transmits the 32-bit registers in 8-bit packages, most significant bit first. 2 hgap 0 0: no gap is introduced between packages. 1: a gap of 7 hclk cycles is introduced between packages. 4:3 hxfer[1:0] 00 00 = hsdc transmits sixteen 32-bit words in the following order: iawv, vawv, ibwv, vbwv, icwv, vcwv, one 32-bit word always equal to inwv, ava, bva, cva, awatt, bwatt, cwatt, avar, bvar, and cvar. 01 = hsdc. for the ADE7878, hsdc transmit s seven instantaneous values of currents and voltages: iawv, vawv, ibwv, vbwv, icwv, vcwv, and inwv. 10 = hsdc transmits nine inst antaneous values of phase powers: ava, bva, cva, awatt, bwatt, cwatt, avar, bvar, and cvar. 11 = reserved. if set, the ADE7878 behaves as if hxfer[1:0] = 00. 5 hsapol 0 0: hsactive output pin is active low. 1: hsactive output pin is active high. 7:6 00 reserved. these bits do not manage any functionality. when hxfer[1:0] is 10, only the instantaneous values of phase powers are transmitted in the following order: ava, bva, cva, awat t, bwat t, c wat t, ava r , bva r , a nd c va r . t he value 11 for hxfer[1:0] is reserved and writing it is equivalent to writing 00, the default value. bit 5 (hsapol) determines the polarity of the hsa pin during communication. when hsapol is 0 (the default value), the hsa pin is active low during the communication. this means that hsa stays high when no communication is in progress. when the communication starts, hsa goes low and stays low until the communication ends. then it goes back to high. when hsapol is 1, the hsa pin is active high during the communi- cation. this means that hsa stays low when no communication is in progress. when the communication starts, hsa goes high and stays high until the communication ends. then it goes back to low. bits[7:6] of hsdc_cfg are reserved. any value written into these bits does not have any consequence on hsdc behavior. figure 86 shows the hsdc transfer protocol for hgap = 0, hxfer[1:0] = 00, and hsapol = 0. note that the hsdc interface sets a bit on the hsd line every hsclk high-to-low transition and that the value of bit hsize is irrelevant. figure 87 shows the hsdc transfer protocol for hsize = 0, hgap = 1, hxfer[1:0] = 00, and hsapol = 0. note that the hsdc interface introduces a seven-hsclk cycles gap between every 32-bit word. figure 88 shows the hsdc transfer protocol for hsize = 1, hgap = 1, hxfer[1:0] = 00, and hsapol = 0. note that the hsdc interface introduces a seven-hsclk cycles gap between every 8-bit word. table 23 lists the time it takes to execute an hsdc data transfer for all hsdc_cfg[7:0] settings. for some settings, the transfer time is less than 125 s (8 khz), the waveform sample registers update rate. this means that the hsdc port transmits data every sampling cycle. for settings in which the transfer time is greater than 125 s, the hsdc port transmits data only in the first of two consecutive 8 khz sampling cycles. this means it transmits registers at an effective rate of 4 khz.
ADE7878 rev. 0 | page 68 of 92 table 23. communication times for various hsdc settings hxfer[1:0] hgap hsize 1 hclk communication time [s] 00 0 n/a 0 64 00 0 n/a 1 128 00 1 0 0 77.125 00 1 0 1 154.25 00 1 1 0 119.25 00 1 1 1 238.25 01 0 n/a 0 28 01 0 n/a 1 56 01 1 0 0 33.25 01 1 0 1 66.5 01 1 1 0 51.625 01 1 1 1 103.25 10 0 n/a 0 36 10 0 n/a 1 72 10 1 0 0 43 10 1 0 1 86 10 1 1 0 66.625 10 1 1 1 133.25 1 n/a means not applicable. hsclk hsd hsa 0 31 0 31 0 31 0 31 iavw (32 bits) vawv (32 bits) ibwv (32 bits) cvar (32 bits) 08510-066 figure 86. hsdc communication for hgap = 0, hxfer[1:0] = 00, and hsapol = 0; hsize is irrelevant sclk hsdata hsactive 0 31 0 31 0 31 iavw (32 bits) 7 hclk cycles vawv (32 bits) ibwv (32 bits) 7 hclk cycles 0 31 cvar (32 bits) 08510-067 figure 87. hsdc communication for hsize = 0, hgap = 1, hxfer[1:0] = 00, and hsapol = 0
ADE7878 rev. 0 | page 69 of 92 sclk hsdata hsactive 24 31 16 23 8 15 0 7 iavw (byte 3) 7 hclk cycles iawv (byte 2) iawv (byte 1) cvar (byte 0) 7 hclk cycles 08510-068 figure 88. hsdc communication for hsize = 1, hgap = 1, hxfer[1:0] = 00, and hsapol = 0 ADE7878 evaluation board an evaluation board built on the ADE7878 configura- tion supports all ADE7878 components. for details, visit www.analog.com/ADE7878 . die version the register named version identifies the version of the die. it is an 8-bit, read-only register located at address 0xe707.
ADE7878 rev. 0 | page 70 of 92 registers list table 24. registers list located in dsp data memory ram address register name r/w 1 bit length bit length during communication 2 type 3 default value description 0x4380 aigain r/w 24 32 zpse s 0x000000 phase a current gain adjust. 0x4381 avgain r/w 24 32 zpse s 0x000000 phase a voltage gain adjust. 0x4382 bigain r/w 24 32 zpse s 0x000000 phase b current gain adjust. 0x4383 bvgain r/w 24 32 zpse s 0x000000 phase b voltage gain adjust. 0x4384 cigain r/w 24 32 zpse s 0x000000 phase c current gain adjust. 0x4385 cvgain r/w 24 32 zpse s 0x000000 phase c voltage gain adjust. 0x4386 nigain r/w 24 32 zpse s 0x000000 neutral current rms offset. 0x4387 airmsos r/w 24 32 zpse s 0x000000 phase a current rms offset. 0x4388 avrmsos r/w 24 32 zpse s 0x000000 phase a voltage rms offset. 0x4389 birmsos r/w 24 32 zpse s 0x000000 phase b current rms offset. 0x438a bvrmsos r/w 24 32 zpse s 0x000000 phase b voltage rms offset. 0x438b cirmsos r/w 24 32 zpse s 0x000000 phase c current rms offset. 0x438c cvrmsos r/w 24 32 zpse s 0x000000 phase c voltage rms offset. 0x438d nirmsos r/w 24 32 zpse s 0x000000 neutral current rms offset. 0x438e avagain r/w 24 32 zpse s 0x000000 phase a apparent power gain adjust. 0x438f bvagain r/w 24 32 zpse s 0x000000 phase b apparent power gain adjust. 0x4390 cvagain r/w 24 32 zpse s 0x000000 phase c apparent power gain adjust. 0x4391 awgain r/w 24 32 zpse s 0x000000 phase a total active power gain adjust. 0x4392 awattos r/w 24 32 zpse s 0x000000 phase a total active power offset adjust. 0x4393 bwgain r/w 24 32 zpse s 0x000000 phase b total active power gain adjust. 0x4394 bwattos r/w 24 32 zpse s 0x000000 phase b total active power offset adjust. 0x4395 cwgain r/w 24 32 zpse s 0x000000 phase c total active power gain adjust. 0x4396 cwattos r/w 24 32 zpse s 0x000000 phase c total active power offset adjust. 0x4397 avargain r/w 24 32 zpse s 0x000000 phase a total reactive power gain adjust. 0x4398 avaros r/w 24 32 zpse s 0x000000 phase a total reactive power offset adjust.
ADE7878 rev. 0 | page 71 of 92 address register name r/w 1 bit length bit length during communication 2 type 3 default value description 0x4399 bvargain r/w 24 32 zpse s 0x000000 phase b total reactive power gain adjust. 0x439a bvaros r/w 24 32 zpse s 0x000000 phase b total reactive power offset adjust. 0x439b cvargain r/w 24 32 zpse s 0x000000 phase c total reactive power gain adjust. 0x439c cvaros r/w 24 32 zpse s 0x000000 phase c total reactive power offset adjust. 0x439d afwgain r/w 24 32 zpse s 0x000000 phase a fundamental active power gain adjust. 0x439e afwattos r/w 24 32 zpse s 0x000000 phase a fundamental active power offset adjust. 0x439f bfwgain r/w 24 32 zpse s 0x000000 phase b fundamental active power gain adjust. 0x43a0 bfwattos r/w 24 32 zpse s 0x000000 phase b fundamental active power offset adjust. 0x43a1 cfwgain r/w 24 32 zpse s 0x000000 phase c fundamental active power gain adjust. 0x43a2 cfwattos r/w 24 32 zpse s 0x000000 phase c fundamental active power offset adjust. 0x43a3 afvargain r/w 24 32 zpse s 0x000000 phase a fundamental reactive power gain adjust. 0x43a4 afvaros r/w 24 32 zpse s 0x000000 phase a fundamental reactive power offset adjust. 0x43a5 bfvargain r/w 24 32 zpse s 0x000000 phase b fundamental reactive power gain adjust. 0x43a6 bfvaros r/w 24 32 zpse s 0x000000 phase b fundamental reactive power offset adjust. 0x43a7 cfvargain, r/w 24 32 zpse s 0x000000 phase c fundamental reactive power gain adjust. 0x43a8 cfvaros r/w 24 32 zpse s 0x000000 phase c fundamental reactive power offset adjust. 0x43a9 vathr1 r/w 24 32 zp u 0x000000 most significant 24 bits of vathr[47:0] threshold used in phase apparent power datapath.
ADE7878 rev. 0 | page 72 of 92 address register name r/w 1 bit length bit length during communication 2 type 3 default value description 0x43aa vathr0 r/w 24 32 zp u 0x000000 less significant 24 bits of vathr[47:0] threshold used in phase apparent power datapath. 0x43ab wthr1 r/w 24 32 zp u 0x000000 most significant 24 bits of wthr[47:0] threshold used in phase total/fundamental active power datapath. 0x43ac wthr0 r/w 24 32 zp u 0x000000 less significant 24 bits of wthr[47:0] threshold used in phase total/fundamental active power datapath. 0x43ad varthr1 r/w 24 32 zp u 0x000000 most significant 24 bits of varthr[47:0] threshold used in phase total/ fundamental reactive power datapath. 0x43ae varthr0 r/w 24 32 zp u 0x000000 less significant 24 bits of varthr[47:0] threshold used in phase total/fundamental reactive power datapath. 0x43af reserved n/a 4 n/a 4 n/a 4 n/a 4 0x000000 this memory location should be kept at 0x000000 for proper operation. 0x43b0 vanoload r/w 24 32 zpse s 0x0000000 no load threshold in the apparent power datapath. 0x43b1 apnoload r/w 24 32 zpse s 0x0000000 no load threshold in the total/fundamental active power datapath. 0x43b2 varnoload r/w 24 32 zpse s 0x0000000 no load threshold in the total/fundamental reactive power datapath. 0x43b3 vlevel r/w 24 32 zpse s 0x000000 register used in the algorithm that computes the fundamental active and reactive powers.
ADE7878 rev. 0 | page 73 of 92 address register name r/w 1 bit length bit length during communication 2 type 3 default value description 0x43b4 reserved n/a 4 n/a 4 n/a 4 n/a 4 0x000000 this location should not be written for proper operation. 0x43b5 dicoeff r/w 24 32 zpse s 0x0000000 register used in the digital integrator algorithm. if the integrator is turned on, it must be set at 0xff8000. in practice, it is transmitted as 0xfff8000. 0x43b6 hpfdis r/w 24 32 zp u 0x000000 disables/enables the hpf in the current datapath (see table 28). 0x43b7 to reserved n/a 4 n/a 4 n/a 4 n/a 4 0x000000 this memory location should be kept at 0x000000 for proper operation. 0x43b8 isumlvl r/w 24 32 zpse s 0x000000 threshold used in comparison between the sum of phase currents and the neutral current. 0x43bf isum r 28 32 zp s n/a 4 sum of iawv, ibwv, and icwv registers 0x43c0 airms r 24 32 zp s n/a 4 phase a current rms value. 0x43c1 avrms r 24 32 zp s n/a 4 phase a voltage rms value. 0x43c2 birms r 24 32 zp s n/a 4 phase b current rms value. 0x43c3 bvrms r 24 32 zp s n/a 4 phase b voltage rms value. 0x43c4 cirms r 24 32 zp s n/a 4 phase c current rms value. 0x43c5 cvrms r 24 32 zp s n/a 4 phase c voltage rms value. 0x43c6 nirms r 24 32 zp s n/a 4 neutral current rms value. 0x43c7 to 0x43ff reserved n/a 4 n/a 4 n/a 4 n/a 4 n/a 4 these memory locations should not be written for proper operation. 1 r is read and w is write. 2 32 zpse = 24-bit signed register that is transmitted as a 32-bit word with four msbs padded with 0s and sign extended to 28 bi ts, whereas 32 zp = 28- or 24-bit signed or unsigned register that is transmitted as a 32-bit word with four eight msbs, respectively, padded with 0s. 3 u is an unsigned register and s is a signed register in twos complement format. 4 n/a means not applicable.
ADE7878 rev. 0 | page 74 of 92 table 25. internal dsp memory ram registers address name r/w 1 bit length bit length during communication type 2 default value description 0xe203 reserved r/w 16 16 u 0x0000 this memory location should not be written for proper operation. 0xe228 run r/w 16 16 u 0x0000 the run register starts and stops the dsp. see the digital signal processor section for more details. 1 r is read and w is write. 2 u is an unsigned register and s is a signed register in twos complement format. table 26. billable registers address register name r/w 1 bit length bit length during communication type 2 default value description 0xe400 awatthr r 32 32 s 0x00000000 phase a total active energy accumulation. 0xe401 bwatthr r 32 32 s 0x00000000 phase b total active energy accumulation. 0xe402 cwatthr r 32 32 s 0x00000000 phase c total active energy accumulation. 0xe403 afwatthr r 32 32 s 0x00000000 phase a fundamental active energy accumulation. 0xe404 bfwatthr r 32 32 s 0x00000000 phase b fundamental active energy accumulation. 0xe405 cfwatthr r 32 32 s 0x00000000 phase c fundamental active energy accumulation. 0xe406 avarhr r 32 32 s 0x00000000 phase a to tal reactive energy accumulation. 0xe407 bvarhr r 32 32 s 0x00000000 phase b to tal reactive energy accumulation. 0xe408 cvarhr r 32 32 s 0x00000000 phase c to tal reactive energy accumulation. 0xe409 afvarhr r 32 32 s 0x00000000 phase a fundamental reactive energy accumulation. 0xe40a bfvarhr r 32 32 s 0x00000000 phase b fundamental reactive energy accumulation. 0xe40b cfvarhr r 32 32 s 0x00000000 phase c fundamental reactive energy accumulation. 0xe40c avahr r 32 32 s 0x00000000 phase a apparent energy accumulation. 0xe40d bvahr r 32 32 s 0x00000000 phase b apparent energy accumulation. 0xe40e cvahr r 32 32 s 0x00000000 phase c apparent energy accumulation. 1 r is read and w is write. 2 u is an unsigned register and s is a signed register in twos complement format. table 27. configuration and power quality registers address name r/w 1 bit length bit length during communication 2 type 3 default value 4 description 0xe500 ipeak r 32 32 u n/a current peak register. see figure 47 and table 29 for details about its composition. 0xe501 vpeak r 32 32 u n/a voltage peak register. see figure 47 and table 30 for details about its composition. 0xe502 status0 r 32 32 u n/a interrupt status register 0. see table 31. 0xe503 status1 r 32 32 u n/a interrupt status register 1. see table 32. 0xe504 aimav r 20 32 zp u n/a phase a current mean absolute value computed during psm0 and psm1 modes.
ADE7878 rev. 0 | page 75 of 92 address name r/w 1 bit length bit length during communication 2 type 3 default value 4 description 0xe505 bimav r 20 32 zp u n/a phase b current mean absolute value computed during psm0 and psm1 modes. 0xe506 cimav r 20 32 zp u n/a phase c current mean absolute value computed during psm0 and psm1 modes. 0xe507 oilvl r/w 24 32 zp u 0xffffff overcurrent threshold. 0xe508 ovlvl r/w 24 32 zp u 0xffffff overvoltage threshold. 0xe509 saglvl r/w 24 32 zp u 0x000000 voltage sag level threshold. 0xe50a mask0 r/w 32 32 u 0x00000000 interrupt enable register 0. see table 33. 0xe50b mask1 r/w 32 32 u 0x00000000 interrupt enable register 1. see table 34. 0xe50c iawv r 24 32 se s na instantaneous value of phase a current. 0xe50d ibwv r 24 32 se s na instantaneous value of phase b current. 0xe50e icwv r 24 32 se s na instantaneous value of phase c current. 0xe50f inwv r 24 32 se s n/a instantaneous value of neutral current. 0xe510 vawv r 24 32 se s na instantaneous value of phase a voltage. 0xe511 vbwv r 24 32 se s na instantaneous value of phase b voltage. 0xe512 vcwv r 24 32 se s na instantaneous value of phase c voltage. 0xe513 awatt r 24 32 se s na instantaneous value of phase a total active power. 0xe514 bwatt r 24 32 se s na instantaneous value of phase b total active power. 0xe515 cwatt r 24 32 se s na instantaneous value of phase c total active power. 0xe516 avar r 24 32 se s na instantaneous value of phase a total reactive power. 0xe517 bvar r 24 32 se s na instantaneous value of phase b total reactive power. 0xe518 cvar r 24 32 se s na instantaneous value of phase c total reactive power. 0xe519 ava r 24 32 se s na instantaneous value of phase a apparent power. 0xe51a bva r 24 32 se s na instantaneous value of phase b apparent power. 0xe51b cva r 24 32 se s na instantaneous value of phase c apparent power. 0xe51f checksum r 32 32 u 0x33666787 checksum verification. see the checksum register section for details. 0xe520 vnom r/w 24 32 zp s 0x000000 nomin al phase voltage rms used in the alternative computation of the apparent power. 0xe521 to 0xe52e reserved these addresses should not be written for proper operation.
ADE7878 rev. 0 | page 76 of 92 address name r/w 1 bit length bit length during communication 2 type 3 default value 4 description 0xe600 phstatus r 16 16 u n/a phase peak register. see table 35. 0xe601 angle0 r 16 16 u n/a time delay 0. see the time interval between phases section for details. 0xe602 angle1 r 16 16 u n/a time delay 1. see the time interval between phases section for details. 0xe603 angle2 r 16 16 u n/a time delay 2. see the time interval between phases section for details. 0xe604 to 0xe606 reserved these addresses should not be written for proper operation. 0xe607 period r 16 16 u n/a network line period. 0xe608 phnoload r 16 16 u na phase no load register. see table 36. 0xe609 to 0xe60b reserved these addresses should not be written for proper operation. 0xe60c linecyc r/w 16 16 u 0xffff line cycle accumulation mode count. 0xe60d zxtout r/w 16 16 u 0xffff zero-crossing timeout count. 0xe60e compmode r/w 16 16 u 0x01ff computation-mode register. see table 37. 0xe60f gain r/w 16 16 u 0x0000 pga gains at adc inputs. see table 38. 0xe610 cfmode r/w 16 16 u 0x0e88 cfx configuration register. see table 39. 0xe611 cf1den r/w 16 16 u 0x0000 cf1 denominator. 0xe612 cf2den r/w 16 16 u 0x0000 cf2 denominator. 0xe613 cf3den r/w 16 16 u 0x0000 cf3 denominator. 0xe614 aphcal r/w 10 16 zp u 0x0000 phase calibration of phase a. see table 40. 0xe615 bphcal r/w 10 16 zp u 0x0000 phase calibration of phase b. see table 40. 0xe616 cphcal r/w 10 16 zp u 0x0000 phase calibration phase of c. see table 40. 0xe617 phsign r 16 16 u na power sign register. see table 41. 0xe618 config r/w 16 16 u 0x0000 ADE7878 configuration register. see table 42. 0xe700 mmode r/w 8 8 u 0x16 measurement mode register. see table 43. 0xe701 accmode r/w 8 8 u 0x00 accumulation mode register. see table 44. 0xe702 lcycmode r/w 8 8 u 0x78 line accumulation mode behavior. see table 46. 0xe703 peakcyc r/w 8 8 u 0x00 peak detection half-line cycles. 0xe704 sagcyc r/w 8 8 u 0x00 sag detection half-line cycles. 0xe705 cfcyc r/w 8 8 u 0x01 number of cf pulses between two consecutive energy latches. see the synchronizing energy registers with cfx outputs section. 0xe706 hsdc_cfg r/w 8 8 u 0x00 hsdc configuration register. see table 47. 0xe707 version r/w 8 8 u version of die. 0xebff reserved 8 8 this address can be used in manipulating the ss pin when spi is chosen as the active port. see the serial interfaces section for details.
ADE7878 rev. 0 | page 77 of 92 address name r/w 1 bit length bit length during communication 2 type 3 default value 4 description 0xec00 lpoilvl r/w 8 8 u 0x07 over current threshold used during psm2 mode (see table 48 in which the register is detailed). 0xec01 config2 r/w 8 8 u 0x00 configuration register used during psm1 mode. see table 49. 1 r is read and w is write. 2 32 zp = 24- or 20-bit signed or unsigned register that is transmitted as a 32-bit word with 8 or 12 msbs, respectively, padded with 0s. 32 se = 24-bit signed register that is transmitted as a 32-bit word sign extended to 32 bits. 16 zp = 10-bit unsigned register that is transmitted as a 16-bit word with six msbs padded with 0s. 3 u is an unsigned register s is a signed register in twos complement format. 4 n/a is not applicable. table 28. hpfdis register (address 0x43b6) bit location default value description 23:0 00000000 when hpfdis = 0x00000000, then all high pass filters in voltage and current channels are enabled. when the register is set to any non zero value, all high pass filters are disabled. table 29. ipeak register (address 0xe500) bit location bit name default value description 23:0 ipeakval[23:0] 0 these bits contain the peak value determined in the current channel. 24 ipphase[0] 0 when this bit is set to 1, ph ase a current generated ipeakval[23:0] value. 25 ipphase[1] 0 when this bit is set to 1, ph ase b current generated ipeakval[23:0] value. 26 ipphase[2] 0 when this bit is set to 1, ph ase c current generated ipeakval[23:0] value. 31:27 00000 these bits are always 0. table 30. vpeak register (address 0xe501) bit location bit name default value description 23:0 vpeakval[23:0] 0 these bits contain the peak value determined in the voltage channel. 24 vpphase[0] 0 when this bit is set to 1, phase a voltage generated vpeakval[23:0] value. 25 vpphase[1] 0 when this bit is set to 1, ph ase b voltage generated vpeakval[23:0] value. 26 vpphase[2] 0 when this bit is set to 1, phase c voltage generated vpeakval[23:0] value. 31:27 00000 these bits are always 0. table 31. status0 register (address 0xe502) bit location bit name default value description 0 aehf 0 when this bit is set to 1, it indicates that bit 30 of any one of the total active energy registers (awat thr, bwat thr, cwat thr) has changed. 1 faehf 0 when this bit is set to 1, it indicates th at bit 30 of any one of the fundamental active energy registers, fwatthr, bfwatthr, or cfwatthr, has changed. 2 rehf 0 when this bit is set to 1, it indicates that bit 30 of any one of the total reactive energy registers (avarhr, bvarhr, cvarhr) has changed. 3 frehf 0 when this bit is set to 1, it indicates that bit 30 of any one of the fundamental reactive energy registers, afvarhr, bfvarhr, or cfvarhr, has changed. 4 vaehf 0 when this bit is set to 1, it indicates that bit 30 of any one of the apparent energy registers (avahr, bvahr, cvahr) has changed. 5 lenergy 0 when this bit is set to 1, in line en ergy accumulation mode, it indicates the end of an integration over an integer number of half-lin e cycles set in the linecyc[15:0] register. 6 revapa 0 when this bit is set to 1, it indicates that the phase a active power identified by bit 6 (revapsel) in the accmode[7:0] register (total or fundamental) has changed sign. the sign itself is indicated in bit 0 (awsign) of the phsign[15:0] register (see table 41).
ADE7878 rev. 0| page 78 of 92 bit location bit name default value description 7 revapb 0 when this bit is set to 1, it indicate s that the phase b active power identified by bit 6 (revapsel) in the accmode[7:0] register (total or fundamental) has changed sign. the sign itself is indicated in bit 1 (bwsign) of the phsign[15:0] register (see table 41). 8 revapc 0 when this bit is set to 1, it indicates that the phase c active power identified by bit 6 (revapsel) in the accmode[7:0] register (total or fundamental) has changed sign. the sign itself is indicated in bit 2 (cwsign) of the phsign[15:0] register (see table 41). 9 revpsum1 0 when this bit is set to 1, it indicates that the sum of all phase powers in the cf1 datapath has changed sign. the sign itself is indicated in bit 3 (sum1sign) of the phsign[15:0] register (see table 41). 10 revrpa 0 when this bit is set to 1, it indicates that the phase a reactive power identified by bit 7 (revrpsel) in the accmode[7:0] register (total or fundamental) has changed sign. the sign itself is indicated in bit 4 (avarsign) of the phsign[15:0] register (see table 41). 11 revrpb 0 when this bit is set to 1, it indicates that the phase b reactive power identified by bit 7 (revrpsel) in the accmode[7:0] register (total or fundamental) has changed sign. the sign itself is indicated in bit 5 (bvarsign) of the phsign[15:0] register (see table 41). 12 revrpc 0 when this bit is set to 1, it indicates that the phase c reactive power identified by bit 7 (revrpsel) in the accmode[7:0] register (total or fundamental) has changed sign. the sign itself is indicated in bit 6 (cvarsign) of the phsign[15:0] register (see table 41). 13 revpsum2 0 when this bit is set to 1, it indicates that the sum of all phase powers in the cf2 datapath has changed sign. the sign itself is indicated in bit 7 (sum2sign) of the phsign[15:0] register (see table 41). 14 cf1 when this bit is set to 1, it indicates that a high to low transition has occurred at cf1 pin; that is, an active low pulse has been generated. the bi t is set even if the cf1 output is disabled by setting bit 9 (cf1dis) to 1 in the cfmode[15:0] register. the type of power used at the cf1 pin is determined by bits[2:0] (cf1sel) in the cfmode[15:0] register (see table 39). 15 cf2 when this bit is set to 1, it indicates that a high-to-low transition has occurred at the cf2 pin; that is, an active low pulse has been generated. the bit is set even if the cf2 output is disabled by setting bit 10 (cf2dis) to 1 in the cfmode[15:0] register. the type of power used at the cf2 pin is determined by bits[5:3] (cf2se l) in the cfmode[15:0] register (see table 39). 16 cf3 when this bit is set to 1, it indicates that a high-to-low transition has occurred at cf3 pin; that is, an active low pulse has been generated. the bi t is set even if the cf3 output is disabled by setting bit 11 (cf3dis) to 1 in the cfmode[15:0] register. the type of power used at the cf3 pin is determined by bits[8:6] (cf3sel) in the cfmode[15:0] register (see table 39). 17 dready 0 when this bit is set to 1, it indicates that all periodical (at 8 khz rate) dsp computations have finished. 18 revpsum3 0 when this bit is set to 1, it indicates that the sum of all phase powers in the cf3 datapath has changed sign. the sign itself is indicated in bit 8 (sum3sign) of the phsign[15:0] register (see table 41). 31:19 reserved 0 0000 0000 0000 reserved. these bits are always 0. table 32. status1 register (address 0xe503) bit location bit name default value description 0 nload 0 when this bit is set to 1, it indicates th at at least one phase entered no load condition based on total active and reactive powers. the phas e is indicated in bits[2:0] (nlphase) in the phnoload[15:0] register (see table 36.) 1 fnload 0 when this bit is set to 1, it indicates th at at least one phase entered no load condition based on fundamental active and reactive powers. the phase is indicated in bits[5:3] (fnlphase) in phnoload[15:0] register (see table 36 in which this register is described). 2 vanload 0 when this bit is set to 1, it indicates th at at least one phase entered no load condition based on apparent power. the phase is indicated in bits[8:6] (vanlphase) in the phnoload[15:0] register (see table 36). 3 zxtova 0 when this bit is set to 1, it indicates that a zero crossing on phase a voltage is missing. 4 zxtovb 0 when this bit is set to 1, it indicates that a zero crossing on phase b voltage is missing.
ADE7878 rev. 0| page 79 of 92 bit location bit name default value description 5 zxtovc 0 when this bit is set to 1, it indicates that a zero crossing on phase c voltage is missing. 6 zxtoia 0 when this bit is set to 1, it indicates that a zero crossing on phase a current is missing. 7 zxtoib 0 when this bit is set to 1, it indicates that a zero crossing on phase b current is missing. 8 zxtoic 0 when this bit is set to 1, it indicates that a zero crossing on phase c current is missing. 9 zxva 0 when this bit is set to 1, it indicates that a zero crossing has been detected on phase a voltage. 10 zxvb 0 when this bit is set to 1, it indicates that a zero crossing has been detected on phase b voltage. 11 zxvc 0 when this bit is set to 1, it indicates that a zero crossing has been detected on phase c voltage. 12 zxia 0 when this bit is set to 1, it indicates that a zero crossing has been detected on phase a current. 13 zxib 0 when this bit is set to 1, it indicates that a zero crossing has been detected on phase b current. 14 zxic 0 when this bit is set to 1, it indicates that a zero crossing has been detected on phase c current. 15 rstdone 1 in case of a software reset command, bit 7 (swrst) is set to 1 in the config[15:0] register, or a transition from psm1, psm2, or psm3 to psm0, or a hardware reset, this bit is set to 1 at the end of the transition process and after all registers changed value to the default. the irq1 pin goes low to signal this moment beca use this interrupt cannot be disabled. 16 sag 0 when this bit is set to 1, it indicates a sa g event has occurred on one of the phases indicated by bits[14:12] (vsphase) in the phstatus[15:0] register (see table 35). 17 oi 0 when this bit is set to 1, it indicates an overcurrent event has occurred on one of the phases indicated by bits[5:3] (oiphase) in the phstatus[15:0] register (see table 35). 18 ov 0 when this bit is set to 1, it indicates an overvoltage event has occurred on one of the phases indicated by bits[11:9] (ovphase) in the phstatus[15:0] register (see table 35). 19 seqerr 0 when this bit is set to 1, it indicates a negative-to-positive zero crossing on the phase a voltage was not followed by a negative-to-positive zero crossing on the phase b voltage but by a negative-to-positive zero crossing on the phase c voltage. 20 mismtch 0 when this bit is set to 1, it indicates isumlvl inwv isum >? , where isumlvl is indicated in the isumlvl[23:0] register. 21 (reserved) reserved. this bit is always set to 1. 22 (reserved) 0 reserved. this bit is always set to 0. 23 pki 0 when this bit is set to 1, it indicates that the period used to detect the peak value in the current channel has ended. the ipeak[31:0] regi ster contains the peak value and the phase where the peak has been detected (see table 29). 24 pkv 0 when this bit is set to 1, it indicates that the period used to detect the peak value in the voltage channel has ended. the vpeak[31:0] regi ster contains the peak value and the phase where the peak has been detected (see table 30). 31:25 reserved 000 0000 reserved. these bits are always 0. table 33. mask0 register (address 0xe50a) bit location bit name default value description 0 aehf 0 when this bit is set to 1, it enables an inte rrupt when bit 30 of any one of the total active energy registers (awatthr, bwatthr, cwatthr) changes. 1 faehf 0 when this bit is set to 1, it enables an in terrupt when bit 30 of any one of the fundamental active energy registers (afwatthr, bfwatthr, or cfwatthr) changes. 2 rehf 0 when this bit is set to 1, it enables an interrupt when bit 30 of any one of the total reactive energy registers (avarhr, bvarhr, cvarhr) changes. 3 frehf 0 when this bit is set to 1, it enables an interrupt when bit 30 of any one of the fundamental reactive energy registers (afvarhr, bfvarhr, or cfvarhr) changes. 4 vaehf 0 when this bit is set to 1, it enables an in terrupt when bit 30 of any one of the apparent energy registers (avahr, bvahr, cvahr) changes. 5 lenergy 0 when this bit is set to 1, in line energy accumulation mode, it enables an interrupt at the end of an integration over an integer number of half-line cycles set in the linecyc[15:0] register.
ADE7878 rev. 0| page 80 of 92 bit location bit name default value description 6 revapa 0 when this bit is set to 1, it enables an in terrupt when the phase a active power identified by bit 6 (revapsel) in the accmode[7:0] register (total or fundamental) changes sign. 7 revapb 0 when this bit is set to 1, it enables an in terrupt when the phase b active power identified by bit 6 (revapsel) in the accmode[7:0] register (total or fundamental) changes sign. 8 revapc 0 when this bit is set to 1, it enables an in terrupt when the phase c active power identified by bit 6 (revapsel) in the accmode[7:0] register (total or fundamental) changes sign. 9 revpsum1 0 when this bit is set to 1, it enables an interrupt when the sum of all phase powers in the cf1 datapath changes sign. 10 revrpa 0 when this bit is set to 1, it enables an inte rrupt when the phase a reactive power identified by bit 7 (revrpsel) in the accmode[7:0] register (total or fundamental) changes sign. 11 revrpb 0 when this bit is set to 1, it enables an interrupt when the phase b reactive power identified by bit 7 (revrpsel) in the accmode[7:0] regist er (total or fundam ental) changes sign. 12 revrpc 0 when this bit is set to 1, it enables an in terrupt when the phase c reactive power identified by bit 7 (revrpsel) in the accmode[7:0] regist er (total or fundam ental) changes sign. 13 revpsum2 0 when this bit is set to 1, it enables an interrupt when the sum of all phase powers in the cf2 datapath changes sign. 14 cf1 when this bit is set to 1, it enables an inte rrupt when a high-to-low transition occurs at the cf1 pin, that is an active low pulse is generated. the interrupt can be enable d even if the cf1 output is disabled by setting bit 9 (cf1dis) to 1 in the cfmode[15:0] register. the type of power used at the cf1 pin is determined by bits[2:0] (c f1sel) in the cfmode[15:0] register (see table 39 ). 15 cf2 when this bit is set to 1, it enables an inte rrupt when a high-to-low transition occurs at cf2 pin, that is an active low pulse is generated. the in terrupt may be enabled even if the cf2 output is disabled by setting bit 10 (cf2dis) to 1 in the cf mode[15:0] register. the type of power used at the cf2 pin is determined by bits[5:3] (c f2sel) in the cfmode[15:0] register (see table 39 ). 16 cf3 when this bit is set to 1, it enables an interr upt when a high to low transition occurs at cf3 pin, that is an active low pulse is generated. the in terrupt may be enabled even if the cf3 output is disabled by setting bit 11 (cf3dis) to 1 in the cfmode[15:0] register. the type of power used at the cf3 pin is determined by bits[8:6] (c f3sel) in the cfmode[15:0] register (see table 39 ). 17 dready 0 when this bit is set to 1, it enables an interrupt when all periodic (at 8 khz rate) dsp computations finish. 18 revpsum3 0 when this bit is set to 1, it enables an interrupt when the sum of all phase powers in the cf3 datapath changes sign. 31:19 reserved 00 0000 0000 0000 reserved. these bits do not manage any functionality. table 34. mask1 register (address 0xe50b) bit location bit name default value description 0 nload 0 when this bit is set to 1, it enables an inte rrupt when at least one phase enters no load condition based on total active and reactive powers. 1 fnload 0 when this bit is set to 1, it enables an in terrupt when at least one phase enters no load condition based on fundamental active and reactive powers. 2 vanload 0 when this bit is set to 1, it enables an in terrupt when at least one phase enters no load condition based on apparent power. 3 zxtova 0 when this bit is set to 1, it enables an in terrupt when a zero crossing on the phase a voltage is missing. 4 zxtovb 0 when this bit is set to 1, it enables an in terrupt when a zero crossing on the phase b voltage is missing. 5 zxtovc 0 when this bit is set to 1, it enables an in terrupt when a zero crossing on the phase c voltage is missing. 6 zxtoia 0 when this bit is set to 1, it enables an in terrupt when a zero crossing on the phase a current is missing.
ADE7878 rev. 0| page 81 of 92 bit location bit name default value description 7 zxtoib 0 when this bit is set to 1, it enables an in terrupt when a zero crossing on the phase b current is missing. 8 zxtoic 0 when this bit is set to 1, it enables an in terrupt when a zero crossing on the phase c current is missing. 9 zxva 0 when this bit is set to 1, it enables an inte rrupt when a zero crossing is detected on the phase a voltage. 10 zxvb 0 when this bit is set to 1, it enables an inte rrupt when a zero crossing is detected on the phase b voltage. 11 zxvc 0 when this bit is set to 1, it enables an in terrupt when a zero crossing is detected on the phase c voltage. 12 zxia 0 when this bit is set to 1, it enables an inte rrupt when a zero crossing is detected on the phase a current. 13 zxib 0 when this bit is set to 1, it enables an inte rrupt when a zero crossing is detected on the phase b current. 14 zxic 0 when this bit is set to 1, it enables an inte rrupt when a zero crossing is detected on the phase c current. 15 rstdone 0 because the rstdone interrupt cannot be di sabled, this bit does not have any functionality attached. it can be set to 1 or cleared to 0 without having any effect. 16 sag 0 when this bit is set to 1, it enables an in terrupt when a sag event occurs on one of the phases indicated by bits[14:12] (vsphase) in the phstatus[15:0] register (see table 35 ). 17 oi 0 when this bit is set to 1, it enables an interrupt when an overcurrent event occurs on one of the phases indicated by bits[5:3] (oiphase) in the phstatus[15:0] register (see table 35 ). 18 ov 0 when this bit is set to 1, it enables an inte rrupt when an overvoltage event occurs on one of the phases indicated by bits[11:9] (ovphas e) in the phstatus[15:0] register (see table 35 ). 19 seqerr 0 when this bit is set to 1, it enables an interrupt when a negative-to-positive zero crossing on phase a voltage is not followed by a negative-to-pos itive zero crossing on phase b voltage, but by a negative-to-positive zero crossing on the phase c voltage. 20 mismtch 0 isumlvl inwv isum >? when this bit is set to 1, it enables an interrupt when is greater than the value indicated in the isumlvl[23:0] register. 22:21 reserved 00 reserved. these bits do not manage any functionality. 23 pki 0 when this bit is set to 1, it enables an interrupt when the period used to detect the peak value in the current channel has ended. 24 pkv 0 when this bit is set to 1, it enables an interr upt when the period used to detect the peak value in the voltage channel has ended. 31:25 reserved 000 0000 reserved. these bits do not manage any functionality. table 35. phstatus register (address 0xe600) bit location bit name default value description 2:0 reserved 000 reserved. these bits are always 0. 3 oiphase[0] 0 when this bit is set to 1, the phase a current generated bit 17 (oi) in the status1[31:0] register. 4 oiphase[1] 0 when this bit is set to 1, the phase b current generated bit 17 (oi) in the status1[31:0] register. 5 oiphase[2] 0 when this bit is set to 1, the phase c current generated bit 17 (oi) in the status1[31:0] register. 8:6 reserved 000 reserved. these bits are always 0. 9 ovphase[0] 0 when this bit is set to 1, the phase a voltage generated bit 18 (ov) in the status1[31:0] register. 10 ovphase[1] 0 when this bit is set to 1, the phase b voltage generated bit 18 (ov) in the status1[31:0] register. 11 ovphase[2] 0 when this bit is set to 1, the phas e c voltage generated bit 18 (ov) in the status1[31:0] register.
ADE7878 rev. 0| page 82 of 92 bit location bit name default value description 12 vsphase[0] 0 when this bit is set to 1, th e phase a voltage generated bit 16 (sag) in the status1[31:0] register. 13 vsphase[1] 0 when this bit is set to 1, th e phase b voltage generated bit 16 (sag) in the status1[31:0] register. 14 vsphase[2] 0 when this bit is set to 1, the phase c voltage generated bit16 (sag) in the status1[31:0] register. 15 reserved 0 reserved. this bit is always 0. table 36. phnoload register (address 0xe608) bit location bit name default value description 0 nlphase[0] 0 0: phase a is out of no load co ndition based on total active/reactive powers. 1: phase a is in no load condition based on total active/reactive powers. this bit is set together with bit 0 (nload) in the status1[31:0] register. 1 nlphase[1] 0 0: phase b is out of no load co ndition based on total active/reactive powers. 1: phase b is in no load condition based on total active/reactive powers. this bit is set together with bit 0 (nload) in the status1[31:0] register. 2 nlphase[2] 0 0: phase c is out of no load co ndition based on total active/reactive powers. 1: phase c is in no load condition based on total active/reactive powers. this bit is set together with bit 0 (nload) in the status1[31:0] register. 3 fnlphase[0] 0 0: phase a is out of no load condit ion based on fundamental active/reactive powers. 1: phase a is in no load condition based on fundamental active/reactive powers. this bit is set together with bit 1 (fnload) in status1[31:0]. 4 fnlphase[1] 0 0: phase b is out of no load condition based on fundamental active/reactive powers. 1: phase b is in no load condition based on fundamental active/reactive powers. this bit is set together with bit 1 (fnload) in status1[31:0]. 5 fnlphase[2] 0 0: phase c is out of no load cond ition based on fundamental active/reactive powers. 1: phase c is in no load condition based on fundamental active/reactive powers. this bit is set together with bit 1 (fnload) in status1[31:0]. 6 vanlphase[0] 0 0: phase a is out of no load condition based on apparent power. 1: phase a is in no load condition based on apparent power. this bit is set together with bit 2 (vanload) in the status1[31:0] register. 7 vanlphase[1] 0 0: phase b is out of no load condition based on apparent power. 1: phase b is in no load condition based on apparent power. this bit is set together with bit 2 (vanload) in the status1[31:0] register. 8 vanlphase[2] 0 0: phase c is out of no load condition based on apparent power. 1: phase c is in no load condition based on apparent power. this bit is set together with bit 2 (vanload) in the status1[31:0] register. 15:9 reserved 000 0000 reserved. these bits are always 0. table 37. compmode register (address 0xe60e) bit location bit name default value description 0 termsel1[0] 1 setting all termsel1[2:0] to 1 signifies the sum of all three phases is included in the cf1 output. phase a is included in th e cf1 outputs calculations. 1 termsel1[1] 1 phase b is included in the cf1 outputs calculations. 2 termsel1[2] 1 phase c is included in the cf1 outputs calculations. 3 termsel2[0] 1 setting all termsel2[2:0] to 1 signifies the sum of all three phases is included in the cf2 output. phase a is included in th e cf2 outputs calculations. 4 termsel2[1] 1 phase b is included in the cf2 outputs calculations. 5 termsel2[2] 1 phase c is included in the cf2 outputs calculations. 6 termsel3[0] 1 setting all termsel3[2:0] to 1 signifies the sum of all three phases is included in the cf3 output. phase a is included in th e cf3 outputs calculations.
ADE7878 rev. 0| page 83 of 92 bit location bit name default value description 7 termsel3[1] 1 phase b is included in the cf3 outputs calculations. 8 termsel3[2] 1 phase c is included in the cf3 outputs calculations. 10:9 anglesel[1:0] 00 00: the angles between phas e voltages and phase currents are measured. 01: the angles between phase voltages are measured. 10: the angles between phase currents are measured. 11: no angles are measured. 11 vnomaen 0 when this bit is 0, the apparent power on phase a is computed regularly. when this bit is 1, the apparent power on phase a is computed using the vnom[23:0] register instead of the regular measured rms phase voltage. 12 vnomben 0 when this bit is 0, the apparent power on phase b is computed regularly. when this bit is 1, the apparent power on phase b is computed using the vnom[23:0] register instead of the regular measured rms phase voltage. 13 vnomcen 0 when this bit is 0, the apparent power on phase c is computed regularly. when this bit is 1, the apparent power on phase c is computed using the vnom[23:0] register instead of the regular measured rms phase voltage. 14 selfreq 0 when the ADE7878 is connected to 50 hz ne tworks, this bit should be cleared to 0 (default value). when the ADE7878 is connected to 60 hz networks, this bit should be set to 1. 15 reserved 0 this bit is 0 by default, and it does not manage any functionality. table 38. gain register (address 0xe60f) bit bit name default value description 2:0 pga1[2:0] 000 phase currents gain selection. 000: gain = 1. 001: gain = 2. 010: gain = 4. 011: gain = 8. 100: gain = 16. 101, 110, 111: reserved. when set, the ADE7878 behaves like pga1[2:0] = 000. 5:3 reservedpga2[2:0] 000 neutral current gain selection. 000: gain = 1. 001: gain = 2. 010: gain = 4. 011: gain = 8. 100: gain = 16. 101, 110, 111: reserved. when set, the ADE7878 behaves like pga2[2:0] = 000. 8:6 pga3[2:0] 000 phase voltages gain selection. 000: gain = 1. 001: gain = 2. 010: gain = 4. 011: gain = 8. 100: gain = 16. 101, 110, 111: reserved. when set, the ADE7878 behaves like pga3[2:0] = 000. 15:9 reserved 000 0000 reserved. these bits do not manage any functionality.
ADE7878 rev. 0| page 84 of 92 table 39. cfmode register (address 0xe610) bit location bit name default value description 2:0 cf1sel[2:0] 000 000: the cf1 frequency is proportional to the sum of total active powers on each phase identified by bits[2:0] (termsel1) in the compmode[15:0] register. 001: the cf1 frequency is proportional to the sum of total reactive powers on each phase identified by bits[2:0] (termsel1) in the compmode[15:0] register. 010: the cf1 frequency is proportional to th e sum of apparent powers on each phase identified by bits[2:0] (termsel1) in the compmode[15:0] register. 011: cf1 frequency is proportional to the sum of fundamental active powers on each phase identified by bits[2:0] (termsel1) in the compmode[15:0] register. 100: cf1 frequency is proportional to the su m of fundamental reactive powers on each phase identified by bits[2:0] (termsel1) in the compmode[15:0] register. 101, 110, 111: reserved. when set, the ADE7878 behaves like cf1sel[2:0] = 000. 5:3 cf2sel[2:0] 001 000: the cf2 frequency is proportional to the sum of total active powers on each phase identified by bits[5:3] (termsel2) in the compmode[15:0] register. 001: the cf2 frequency is proportional to the sum of total reactive powers on each phase identified by bits[5:3] (termsel2) in the compmode[15:0] register. 010: the cf2 frequency is proportional to th e sum of apparent powers on each phase identified by bits[5:3] (termsel2) in the compmode[15:0] register. 011: cf2 frequency is proportional to the sum of fundamental active powers on each phase identified by bits[5:3] (termsel2) in the compmode[15:0] register. 100: cf2 frequency is proportional to the su m of fundamental reactive powers on each phase identified by bits[5:3] (termsel2) in the compmode[15:0] register. 101,110,111: reserved. when set, theADE7878 behaves like cf2sel[2:0] = 000. 8:6 cf3sel[2:0] 010 000: the cf3 frequency is proportional to the sum of total active powers on each phase identified by bits[8:6] (termsel3) in the compmode[15:0] register. 001: the cf3 frequency is proportional to the sum of total reactive powers on each phase identified by bits[8:6] (termsel3) in the compmode[15:0] register. 010: the cf3 frequency is proportional to th e sum of apparent powers on each phase identified by bits[8:6] (termsel3) in the compmode[15:0] register. 011: cf3 frequency is proportional to the sum of fundamental active powers on each phase identified by bits[8:6] (termsel3) in the compmode[15:0] register. 100: cf3 frequency is proportional to the su m of fundamental reactive powers on each phase identified by bits[8:6] (termsel3) in the compmode[15:0] register. 101,110,111: reserved. when set, the ADE7878 behaves like cf3sel[2:0] = 000. 9 cf1dis 1 when this bit is set to 1, the cf1 outp ut is disabled. the respective digital to frequency converter remains enabled even if cf1dis = 1. when set to 0, the cf1 output is enabled. 10 cf2dis 1 when this bit is set to 1, the cf2 outp ut is disabled. the respective digital to frequency converter remains enabled even if cf2dis = 1. when set to 0, the cf2 output is enabled. 11 cf3dis 1 when this bit is set to 1, the cf3 o utput is disabled. the respective digital to frequency converter remains enabled even if cf3dis = 1. when set to 0, the cf3 output is enabled. 12 cf1latch 0 when this bit is set to 1, the content of the corresponding energy registers is latched when a cf1 pulse is generated. see synchronizing energy registers with cfx outputs section. 13 cf2latch 0 when this bit is set to 1, the content of the corresponding energy registers is latched when a cf2 pulse is generated. see synchronizing energy registers with cfx outputs section. 14 cf3latch 0 when this bit is set to 1, the content of the corresponding energy registers is latched when a cf3 pulse is generated. see synchronizing energy registers with cfx outputs section. 15 reserved 0 reserved. this bit does not manage any functionality.
ADE7878 rev. 0| page 85 of 92 table 40. aphcal, bphcal, cphcal registers (address 0xe614, address 0xe615, address 0xe616) bit location bit name default value description 9:0 phcalval 0000000000 if current channel compensation is ne cessary, these bits can vary only between 0 and 383. if voltage channel compensation is necessary, these bits can vary only between 512 and 575. if the phcalval bits are set with numbers between 384 and 511, the compensation behaves like phcalval set between 256 and 383. if the phcalval bits are set with numbers between 512 and 1023, the compensation behaves like phcalval bits set between 384 and 511. 15:10 reserved 000000 reserved. these bits do not manage any functionality. table 41. phsign register (address 0xe617) bit location bit name default value description 0 awsign 0 0: if the active power identified by bit 6 (revapsel) in the accmode[7:0] register (total of fundamental) on phase a is positive. 1: if the active power identified by bit 6 (revapsel) in the accmode[7:0] register (total of fundamental) on phase a is negative. 1 bwsign 0 0: if the active power identified by bit 6 (revapsel) in the accmode[7:0] register (total of fundamental) on phase b is positive. 1: if the active power identified by bit 6 (revapsel) in the accmode[7:0] register (total of fundamental) on phase b is negative. 2 cwsign 0 0: if the active power identified by bit 6 (revapsel) in the accmode[7:0] register (total of fundamental) on phase c is positive. 1: if the active power identified by bit 6 (revapsel) bit in the accmode[7:0] register (total of fundamental) on phase c is negative. 3 sum1sign 0 0: if the sum of all phase powers in the cf1 datapath is positive. 1: if the sum of all phase powers in the cf 1 datapath is negative. phase powers in the cf1 datapath are identified by bits[2:0] (termsel 1) of the compmode[15:0] register and by bits[2:0] (cf1sel) of the cfmode[15:0] register. 4 avarsign 0 0: if the reactive power identified by bi t 7 (revrpsel) in the accmode[7:0] register (total of fundamental) on phase a is positive. 1: if the reactive power identified by bit 7 (revrpsel) in the accmode[7:0] register (total of fundamental) on phase a is negative. 5 bvarsign 0 0: if the reactive power identified by bit 7 (revrpsel) in the accmode[7:0] register (total of fundamental) on phase b is positive. 1: if the reactive power identified by bit 7 (revrpsel) in the accmode[7:0] register (total of fundamental) on phase b is negative. 6 cvarsign 0 0: if the reactive power identified by bi t 7 (revrpsel) in the accmode[7:0] register (total of fundamental) on phase c is positive. 1: if the reactive power identified by bit 7 (revrpsel) in the accmode[7:0] register (total of fundamental) on phase c is negative. 7 sum2sign 0 0: if the sum of all phase powers in the cf2 datapath is positive. 1: if the sum of all phase powers in the cf 2 datapath is negative. phase powers in the cf2 datapath are identified by bits[5:3] (termsel 2) of the compmode[15:0] register and by bits[5:3] (cf2sel) of the cfmode[15:0] register. 8 sum3sign 0 0: if the sum of all phase powers in the cf3 datapath is positive. 1: if the sum of all phase powers in the cf 3 datapath is negative. phase powers in the cf3 datapath are identified by bits[8:6] (termsel 3) of the compmode[15:0] register and by bits[8:6] (cf3sel) of the cfmode[15:0] register. 15:9 reserved 000 0000 reserved. these bits are always 0.
ADE7878 rev. 0| page 86 of 92 table 42. config register (address 0xe618) bit location bit name default value description 0 inten 0 integrator enable. when this bit is set to 1, the internal digital integrator is enabled for use in meters utilizing rogowski coils on a ll 3-phase and neutral current inputs. when this bit is cleared to 0, the in ternal digital integrator is disabled. 2:1 reserved 00 reserved. these bits do not manage any functionality. 3 swap 0 when this bit is set to 1, the voltage ch annel outputs are swapped with the current channel outputs. thus, the current channel information is pr esent in the voltage channel registers and vice versa. 4 mod1short 0 when this bit is set to 1, the voltage cha nnel adcs behave as if the voltage inputs were put to ground. 5 mod2short 0 when this bit is set to 1, the current chan nel adcs behave as if the voltage inputs were put to ground. 6 hsdcen 0 when this bit is set to 1, the hsdc serial port is enabled, and hsclk functionality is chosen at cf3/hsclk pin. when this bit is cleared to 0, hsdc is disabl ed, and cf3 functionality is chosen at cf3/hsclk pin. 7 swrst 0 when this bit is set to 1, a software reset is initiated. 9:8 vtoia[1:0] 00 these bits decide what phase voltage is considered together with phase a current in the power path. 00 = phase a voltage. 01 = phase b voltage. 10 = phase c voltage. 11 = reserved. when set, the ADE7878 behaves like vtoia[1:0] = 00. 11:10 vtoib[1:0] 00 these bits decide what phase voltage is considered together with phase b current in the power path. 00 = phase b voltage. 01 = phase c voltage. 10 = phase a voltage. 11 = reserved. when set, the ADE7878 behaves like vtoib[1:0] = 00. 13:12 vtoic[1:0] 00 these bits decide what phase voltage is considered together with phase c current in the power path. 00 = phase c voltage. 01 = phase a voltage. 10 = phase b voltage. 11 = reserved. when set, the ADE7878 behaves like vtoic[1:0] = 00. 15:14 reserved 0 reserved. these bits do not manage any functionality.
ADE7878 rev. 0| page 87 of 92 table 43. mmode register (address 0xe700) bit location bit name default value description 1:0 persel[1:0] 00 00: phase a selected as the source of the voltage line period measurement. 01: phase b selected as the source of the voltage line period measurement. 10: phase c selected as the source of the voltage line period measurement. 11: reserved. when set, the ADE7878 behaves like persel[1:0] = 00. 2 peaksel[0] 1 peaksel[2:0] bits can all be set to 1 s imultaneously to allow peak detection on all three phases simultaneously. if more than one peakse l[2:0] bits are set to 1, then the peak measurement period indicated in the peakcyc[7: 0] register decreases accordingly because zero crossings are detected on more than one phase. when this bit is set to 1, phase a is selected for the voltage and current peak registers. 3 peaksel[1] 1 when this bit is set to 1, phase b is selected for the voltage and current peak registers. 4 peaksel[2] 1 when this bit is set to 1, phase c is selected for the voltage and current peak registers. 7:5 reserved 000 reserved. these bits do not manage any functionality. table 44. accmode register (address 0xe701) bit location bit name default value description 1:0 wattacc[1:0] 00 00: signed accumulation mode of the total active and fundamental powers. 01: reserved. when set, the ADE7878 behaves like wattacc[1:0] = 00. 10: reserved. when set, the ADE7878 behaves like wattacc[1:0] = 00. 11: absolute accumulation mode of the total active and fundamental powers. 3:2 varacc[1:0] 00 00: signed accumulation of the total reactive and fundamental powers. 01: reserved. when set, the ADE7878 behaves like varacc[1:0] = 00. 10: the total reactive and fundamental powers are accumulated, depending on the sign of the total active and fundamental power: if the active power is positive, the reactive power is accumulated as is, whereas if the active power is negative, the reactive power is accumulated with reversed sign. 11: reserved. when set, theADE7878 behaves like varacc[1:0] = 00. 5:4 consel[1:0] 00 these bits select the in puts to the energy accumulation registers. ia, ib, and ic are ia, ib, and ic shifted respectively by ?90. see table 45 . 00: 3-phase four wires with three voltage sensors. 01: 3-phase three wires delta connection. 10: 3-phase four wires with two voltage sensors. 11: 3-phase four wires delta connection. 6 revapsel 0 0: the total active power on each phase is used to trigger a bit in the status0[31:0] register as follows: on phase a, triggers bit 6 (revapa) ; on phase b, triggers bit 7 (revapb); and on phase c, triggers bit 8 (revapc). 1: the fundamental active power on each phas e is used to trigger a bit in the status0[31:0] register as follows: on phase a triggers bit 6 (revapa), on phase b triggers bit 7 (revapb), and on phase c triggers bit 8 (revapc). 7 revrpsel 0 0: the total active power on each phase is used to trigger a bit in the status0[31:0] register as follows: on phase a, triggers bit 10 (revrpa); on phase b, triggers bit 11 (revrpb); and on phase c, triggers bit 12 (revrpc). 1: the fundamental active power on each phas e is used to trigger a bit in the status0[31:0] register as follows: on phase a, triggers bit 10 (revrpa); on phase b, triggers bit 11 (revrpb); and on phase c, triggers bit 12 (revrpc).
ADE7878 rev. 0| page 88 of 92 table 45. consel[1:0] bits in energy registers energy registers consel[1:0]=00 consel[1:0]=01 consel[1:0]=10 consel[1:0]=11 awat thr, afwat thr va ia va ia va ia va ia bwatthr, bfwatthr vb ib 0 vb = ?va ? vc vb = ?va vb ib vb ib cwatthr, cfwatthr vc ic vc ic vc x ic vc ic avarhr, afvarhr va ia va x ia va ia va ia bvarhr, bfvarhr vb ib 0 vb = ?va ? vc vb = ?va vb ib vb ib cvarhr, cfvarhr vc ic vc ic vc ic vc ic avahr va rms ia rms va rms ia rms va rms ia rms va rms ia rms bvahr vb rms ib rms 0 vb rms ib rms vb rms ib rms cvahr vc rms ic rms vc rms ic rms vc rms ic rms vc rms ic rms table 46. lcycmode register (address 0xe702) bit location bit name default value description 0 lwatt 0 0: the watt-hour accumulation registers (awatthr, bwatthr, cwatthr, afwatthr, bfwatthr, and cfwatthr) are placed in regular accumulation mode. 1: the watt-hour accumulation registers (awatthr, bwatthr, cwatthr, afwatthr, bfwatthr, and cfwatthr) are placed into line-cycle accumulation mode. 1 lvar 0 0: the var-hour accumulation registers (avarhr, bvarhr, cvarhr) are placed in regular accumulation mode. 1: the var-hour accumulation registers (ava rhr, bvarhr, cvarhr) are placed into line-cycle accumulation mode. 2 lva 0 0: the va-hour accumulation registers (avahr, bvahr, cvahr) are placed in regular accumulation mode. 1: the va-hour accumulation registers (av ahr, bvahr, cvahr) are placed into line-cycle accumulation mode. 3 zxsel[0] 1 0: phase a is not selected for zero-crossings counts in the line cycle accumulation mode. 1: phase a is selected for zero-crossings counts in the line cycle accumulation mode. if more than one phase is selected for zero-crossing detection, the accumulation time is shortened accordingly. 4 zxsel[1] 1 0: phase b is not selected for zero-crossings counts in the line cycle accumulation mode. 1: phase b is selected for zero-crossings counts in the line cycle accumulation mode. 5 zxsel[2] 1 0: phase c is not selected for zero-crossings counts in the line cycle accumulation mode. 1: phase c is selected for zero-crossings counts in the line cycle accumulation mode. 6 rstread 1 0: read-with-reset of all energy registers is disabled. clear this bit to 0 when bits[2:0] (lwatt, lvar, lva) are set to 1. 1: enables read-with-reset of all xwatthr, xvarhr, xvahr, xfwatthr, and xfvarhr registers. this means that a read of those registers resets them to 0. 7 reserved 0 reserved. this bit does not manage any functionality. table 47. hsdc_cfg register (address 0xe706) bit location bit name default value description 0 hclk 0 0: hsclk is 8 mhz. 1: hsclk is 4 mhz. 1 hsize 0 0: hsdc transmits the 32-bit registers in 32-bit packages, most significant bit first. 1: hsdc transmits the 32-bit registers in 8-bit packages, most significant bit first. 2 hgap 0 0: no gap is introduced between packages. 1: a gap of seven hclk cycles is introduced between packages.
ADE7878 rev. 0| page 89 of 92 bit location bit name default value description 4:3 hxfer[1:0] 00 00 = hsdc transmits sixteen 32-bit words in the following order: iawv, vawv, ibwv, vbwv, icwv, vcwv, one 32-bit word equal to inwv, ava, bva, cva, awatt, bwatt, cwatt, avar, bvar, and cvar. 01 = hsdc transmits seven instantaneous va lues of currents and voltages: iawv, vawv, ibwv, vbwv, icwv, vcwv, and inwv. 10 = hsdc transmits nine instantaneous valu es of phase powers: ava, bva, cva, awatt, bwatt, cwatt, avar, bvar, and cvar. 11 = reserved. if set, the ADE7878 behaves as if hxfer[1:0] = 00. 5 hsapol 0 0: hsactive output pin is active low. 1: hsactive output pin is active high. 7:6 reserved 00 reserved. these bits do not manage any functionality. table 48. lpoilvl register (address 0xec00) bit location bit name default value description 2:0 lpoil[2:0] 111 threshold is put at a value co rresponding to full scale multiplied by lpoil/8. 7:3 lpline[4:0] 000 the measurement period is (lpline + 1)/50 seconds. table 49. config2 register (address 0xec01) bit location bit name default value description 0 extrefen 0 when this bit is 0, it signifies that the internal voltage reference is used in the adcs. when this bit is 1, an external reference is connected to the pin 17 ref in/out . 1 i2c_lock 0 when this bit is 0, the ss /hsa pin can be toggled three times to activate the spi port. if i 2 c is the active serial port, this bit must be set to 1 to lo ck it in. from this moment on, spurious toggling of the ss pin and an eventual switch into using the spi port are no longer possible. if spi is the active serial port, any write to the config2[7:0] register locks the port. from this moment on, a switch into using i 2 c port is no longer possible. once locked, the serial port choice is maintained when theADE7878 changes psmx power modes. 7:2 reserved 0 reserved. these bits do not manage any functionality.
ADE7878 rev. 0| page 90 of 92 outline dimensions 111808-a 0.50 bsc bottom view top view pin 1 indicator exposed pad p i n 1 i n d i c a t o r seating plane 0.05 max 0.02 nom 0.20 ref coplanarity 0.08 0.30 0.23 0.18 6.10 6.00 sq 5.90 0.80 0.75 0.70 for proper connection of the exposed pad, refer to the pin configuration and function descriptions section of this data sheet. 0.45 0.40 0.35 0.25 min 4.45 4.30 sq 4.25 compliant to jedec standards mo-220-wjjd. 40 1 11 20 21 30 31 10 figure 89. 40-lead lead frame chip scale package [lfcsp_wq] 6 mm x 6 mm body, very very thin quad (cp-40-10) dimensions shown in millimeters ordering guide model 1 temperature range package description package option ADE7878acpz ?40c to +85c 40-lead lfcsp_wq cp-40-10 ADE7878acpz-rl ?40c to +85c 40-lead lfcsp_wq, 13 tape and reel cp-40-10 1 z = rohs compliant part.
ADE7878 rev. 0| page 91 of 92 notes
ADE7878 rev. 0| page 92 of 92 notes i 2 c refers to a communications protocol originally developed by philips semiconductors (now nxp semiconductors). ?2010 analog devices, inc. all rights reserved. trademarks and registered trademarks are the prop erty of their respective owners. d08510-0-2 /10(0)


▲Up To Search▲   

 
Price & Availability of ADE7878

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X